summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-04-10 04:39:42 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-04-10 04:39:42 +0000
commitfd15ab77cff7d1685f86a25686c91e518b748a35 (patch)
treed7b82e7e02523d99914225e0018f22ab98271f68 /sys
parent4857bf08584d5ef1029a84a3958bd461d93b6361 (diff)
output routine enqueues and calls start, rather than requeueing for input.
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_enc.c69
1 files changed, 14 insertions, 55 deletions
diff --git a/sys/net/if_enc.c b/sys/net/if_enc.c
index af9c4169ef2..339cc1037d0 100644
--- a/sys/net/if_enc.c
+++ b/sys/net/if_enc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_enc.c,v 1.25 2000/04/10 02:34:07 angelos Exp $ */
+/* $OpenBSD: if_enc.c,v 1.26 2000/04/10 04:39:41 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -207,12 +207,8 @@ struct ifnet *ifp;
/* See if we need to notify a key mgmt. daemon to setup SAs */
if (ntohl(enc->sc_spi) == SPI_LOCAL_USE)
{
- /*
- * XXX Can't do this for now, as there's no way for
- * XXX key mgmt. to specify link-layer properties
- * XXX (e.g., encrypt everything on this interface)
- */
#ifdef notyet
+ /* XXX Currently unsupported */
if (tdb->tdb_satype != SADB_X_SATYPE_BYPASS)
pfkeyv2_acquire(tdb, 0); /* No point checking for errors */
#endif
@@ -277,9 +273,6 @@ struct ifnet *ifp;
#endif /* IPSEC */
}
-/*
- * Shamelessly stolen from looutput()
- */
int
encoutput(ifp, m, dst, rt)
struct ifnet *ifp;
@@ -287,8 +280,7 @@ register struct mbuf *m;
struct sockaddr *dst;
register struct rtentry *rt;
{
- register struct ifqueue *ifq = 0;
- int s, isr;
+ int s;
if ((m->m_flags & M_PKTHDR) == 0)
panic("encoutput(): no HDR");
@@ -303,56 +295,22 @@ register struct rtentry *rt;
rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
}
- ifp->if_opackets++;
- ifp->if_obytes += m->m_pkthdr.len;
-
- switch (dst->sa_family)
- {
-#ifdef INET
- case AF_INET:
- ifq = &ipintrq;
- isr = NETISR_IP;
- break;
-#endif
-#ifdef INET6
- case AF_INET6:
- ifq = &ip6intrq;
- isr = NETISR_IPV6;
- break;
-#endif
-#ifdef NS
- case AF_NS:
- ifq = &nsintrq;
- isr = NETISR_NS;
- break;
-#endif
-#ifdef ISO
- case AF_ISO:
- ifq = &clnlintrq;
- isr = NETISR_ISO;
- break;
-#endif
- default:
- m_freem(m);
- return (EAFNOSUPPORT);
- }
-
s = splimp();
- if (IF_QFULL(ifq))
- {
- IF_DROP(ifq);
+ if (IF_QFULL(&ifp->if_snd)) {
+ ifp->if_oerrors++;
m_freem(m);
splx(s);
- return (ENOBUFS);
+ return 0;
}
-
- IF_ENQUEUE(ifq, m);
- schednetisr(isr);
- /* Statistics */
- ifp->if_ipackets++;
- ifp->if_ibytes += m->m_pkthdr.len;
+ ifp->if_opackets++;
+ ifp->if_obytes += m->m_pkthdr.len;
+
+ IF_ENQUEUE(&ifp->if_snd, m);
splx(s);
+
+ (ifp->if_start)(ifp);
+
return (0);
}
@@ -393,6 +351,7 @@ caddr_t data;
case SIOCSIFADDR:
case SIOCAIFADDR:
case SIOCSIFDSTADDR:
+ case SIOCSIFFLAGS:
break;
case SIOCGENCSA: