Bug #789

(part 2) pppX fix for altq/pf

Added by andrew_atrens almost 7 years ago. Updated almost 7 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

Oops, this is also needed!

Index: ppp_tty.c
===================================================================
RCS file: /usr/dfly/repo/src/sys/net/ppp_layer/ppp_tty.c,v
retrieving revision 1.23
diff -u -r1.23 ppp_tty.c
--- ppp_tty.c 22 Dec 2006 23:44:57 -0000 1.23
+++ ppp_tty.c 11 Apr 2007 03:41:54 -0000
@@ -378,12 +368,16 @@
uio->uio_resid < PPP_HDRLEN)
return (EMSGSIZE);

crit_enter();
for (mp = &m0; uio->uio_resid; mp = &m->m_next) {
- MGET(m, MB_WAIT, MT_DATA);
+ if ( mp == &m0 ) {
+ MGETHDR(m, MB_WAIT, MT_DATA);
+ m->m_pkthdr.len = uio->uio_resid - PPP_HDRLEN;
+ m->m_pkthdr.rcvif = NULL;
+ }
+ else
+ MGET(m, MB_WAIT, MT_DATA);
if ((*mp = m) == NULL) {
m_freem(m0);
- crit_exit();
return (ENOBUFS);
}
m->m_len = 0;

History

#1 Updated by dillon almost 7 years ago

:Oops, this is also needed!

p.s. all these patches are malformed. Your mailer is doing something
bad to them. Don't repost, I'm patching it manually. But just to let
you know.

-Matt

:
:Index: ppp_tty.c
:===================================================================
:RCS file: /usr/dfly/repo/src/sys/net/ppp_layer/ppp_tty.c,v
:retrieving revision 1.23
:diff -u -r1.23 ppp_tty.c
:--- ppp_tty.c 22 Dec 2006 23:44:57 -0000 1.23
:+++ ppp_tty.c 11 Apr 2007 03:41:54 -0000
:@@ -378,12 +368,16 @@
: uio->uio_resid < PPP_HDRLEN)
: return (EMSGSIZE);
:
: crit_enter();
: for (mp = &m0; uio->uio_resid; mp = &m->m_next) {
:- MGET(m, MB_WAIT, MT_DATA);
:+ if ( mp == &m0 ) {
:+ MGETHDR(m, MB_WAIT, MT_DATA);
:+ m->m_pkthdr.len = uio->uio_resid - PPP_HDRLEN;
:+ m->m_pkthdr.rcvif = NULL;
:+ }
:+ else
:+ MGET(m, MB_WAIT, MT_DATA);
: if ((*mp = m) == NULL) {
: m_freem(m0);
:- crit_exit();
: return (ENOBUFS);
: }
: m->m_len = 0;
:

Matthew Dillon
<>

#2 Updated by dillon almost 7 years ago

:Oops, this is also needed!
:
: crit_enter();
: for (mp = &m0; uio->uio_resid; mp = &m->m_next) {
:- MGET(m, MB_WAIT, MT_DATA);
:+ if ( mp == &m0 ) {
:+ MGETHDR(m, MB_WAIT, MT_DATA);
:+ m->m_pkthdr.len = uio->uio_resid - PPP_HDRLEN;
:+ m->m_pkthdr.rcvif = NULL;
:+ }
:+ else
:+ MGET(m, MB_WAIT, MT_DATA);
: if ((*mp = m) == NULL) {
: m_freem(m0);
:- crit_exit();

I think that crit_exit() has to stay.

-Matt

#3 Updated by hasso almost 7 years ago

#788 contains correct fix.

Also available in: Atom PDF