summaryrefslogtreecommitdiff
path: root/sys/net/if_atmsubr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/if_atmsubr.c')
-rw-r--r--sys/net/if_atmsubr.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/sys/net/if_atmsubr.c b/sys/net/if_atmsubr.c
index c9437d5d1aa..10c13bbbb73 100644
--- a/sys/net/if_atmsubr.c
+++ b/sys/net/if_atmsubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_atmsubr.c,v 1.15 2001/06/15 03:38:33 itojun Exp $ */
+/* $OpenBSD: if_atmsubr.c,v 1.16 2001/06/27 06:07:38 kjc Exp $ */
/*
*
@@ -107,17 +107,25 @@ atm_output(ifp, m0, dst, rt0)
struct rtentry *rt0;
{
u_int16_t etype = 0; /* if using LLC/SNAP */
- int s, error = 0, sz;
+ int s, error = 0, sz, len;
struct atm_pseudohdr atmdst, *ad;
register struct mbuf *m = m0;
register struct rtentry *rt;
struct atmllc *atmllc;
u_int32_t atm_flags;
+ ALTQ_DECL(struct altq_pktattr pktattr;)
if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
senderr(ENETDOWN);
/*
+ * if the queueing discipline needs packet classification,
+ * do it before prepending link headers.
+ */
+ IFQ_CLASSIFY(&ifp->if_snd, m,
+ (dst != NULL ? dst->sa_family : AF_UNSPEC), &pktattr);
+
+ /*
* check route
*/
if ((rt = rt0) != NULL) {
@@ -160,14 +168,6 @@ atm_output(ifp, m0, dst, rt0)
etype = ETHERTYPE_IP;
else
etype = ETHERTYPE_IPV6;
-# ifdef ATM_PVCEXT
- if (ifp->if_flags & IFF_POINTOPOINT) {
- /* pvc subinterface */
- struct pvcsif *pvcsif = (struct pvcsif *)ifp;
- atmdst = pvcsif->sif_aph;
- break;
- }
-# endif
if (!atmresolve(rt, m, dst, &atmdst)) {
m = NULL;
/* XXX: atmresolve already free'd it */
@@ -235,15 +235,14 @@ atm_output(ifp, m0, dst, rt0)
* Queue message on interface, and start output if interface
* not yet active.
*/
-
+ len = m->m_pkthdr.len;
s = splimp();
- if (IF_QFULL(&ifp->if_snd)) {
- IF_DROP(&ifp->if_snd);
+ IFQ_ENQUEUE(&ifp->if_snd, m, &pktattr, error);
+ if (error) {
splx(s);
- senderr(ENOBUFS);
+ return (error);
}
- ifp->if_obytes += m->m_pkthdr.len;
- IF_ENQUEUE(&ifp->if_snd, m);
+ ifp->if_obytes += len;
if ((ifp->if_flags & IFF_OACTIVE) == 0)
(*ifp->if_start)(ifp);
splx(s);