diff options
author | mlaier <mlaier@FreeBSD.org> | 2004-06-15 23:57:42 +0000 |
---|---|---|
committer | mlaier <mlaier@FreeBSD.org> | 2004-06-15 23:57:42 +0000 |
commit | 02300f227ffc4cadfc19d925b489f443132b1376 (patch) | |
tree | d5efbd7578982ffd4278b8857f7acb6969a2ffa2 /sys/net/if_spppsubr.c | |
parent | efc9e973bf86814f88bf2b016d7b3d6d866fb32d (diff) | |
download | FreeBSD-src-02300f227ffc4cadfc19d925b489f443132b1376.zip FreeBSD-src-02300f227ffc4cadfc19d925b489f443132b1376.tar.gz |
Replace IF_HANDOFF with new IFQ_HANDOFF to enqueue with ALTQ once enabled on
the respective drivers.
Diffstat (limited to 'sys/net/if_spppsubr.c')
-rw-r--r-- | sys/net/if_spppsubr.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index 66b6412..d086f14 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -741,7 +741,7 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, struct sppp *sp = (struct sppp*) ifp; struct ppp_header *h; struct ifqueue *ifq = NULL; - int s, rv = 0; + int s, error, rv = 0; int ipproto = PPP_IP; int debug = ifp->if_flags & IFF_DEBUG; @@ -781,7 +781,6 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, s = splimp(); } - ifq = (struct ifqueue *)&ifp->if_snd; #ifdef INET if (dst->sa_family == AF_INET) { /* XXX Check mbuf length here? */ @@ -811,9 +810,11 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, /* * Put low delay, telnet, rlogin and ftp control packets - * in front of the queue. + * in front of the queue or let ALTQ take care. */ - if (_IF_QFULL(&sp->pp_fastq)) + if (ALTQ_IS_ENABLED(&ifp->if_snd)) + ; + else if (_IF_QFULL(&sp->pp_fastq)) ; else if (ip->ip_tos & IPTOS_LOWDELAY) ifq = &sp->pp_fastq; @@ -939,7 +940,11 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, * Queue message on interface, and start output if interface * not yet active. */ - if (! IF_HANDOFF_ADJ(ifq, m, ifp, 3)) { + if (ifq != NULL) + error = !(IF_HANDOFF_ADJ(ifq, m, ifp, 3)); + else + IFQ_HANDOFF_ADJ(ifp, m, 3, error); + if (error) { ++ifp->if_oerrors; splx (s); return (rv? rv: ENOBUFS); |