diff options
| author | Jonathan Lemon <jlemon@FreeBSD.org> | 2003-03-04 23:19:55 +0000 |
|---|---|---|
| committer | Jonathan Lemon <jlemon@FreeBSD.org> | 2003-03-04 23:19:55 +0000 |
| commit | 1cafed3941f1a4e9d2beb4fb126e91018505dfd4 (patch) | |
| tree | f304f726e8973253d3e8a87e56119fec0276a61c /sys/netgraph | |
| parent | c141c242ac0a55a34b58cf2b06d13964d00507a4 (diff) | |
Notes
Diffstat (limited to 'sys/netgraph')
| -rw-r--r-- | sys/netgraph/ng_base.c | 2 | ||||
| -rw-r--r-- | sys/netgraph/ng_iface.c | 51 | ||||
| -rw-r--r-- | sys/netgraph/ng_ip_input.c | 3 |
3 files changed, 50 insertions, 6 deletions
diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index 4c8dde3dba039..efa0e03f88122 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -2987,7 +2987,7 @@ ngb_mod_event(module_t mod, int event, void *data) mtx_init(&ng_idhash_mtx, "netgraph idhash mutex", NULL, 0); mtx_init(&ngq_mtx, "netgraph netisr mutex", NULL, 0); s = splimp(); - error = register_netisr(NETISR_NETGRAPH, ngintr); + netisr_register(NETISR_NETGRAPH, (netisr_t *)ngintr, NULL); splx(s); break; case MOD_UNLOAD: diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c index 4068f258dd62f..efaee7fa95145 100644 --- a/sys/netgraph/ng_iface.c +++ b/sys/netgraph/ng_iface.c @@ -1,4 +1,3 @@ - /* * ng_iface.c * @@ -58,6 +57,7 @@ #include <sys/malloc.h> #include <sys/mbuf.h> #include <sys/errno.h> +#include <sys/random.h> #include <sys/sockio.h> #include <sys/socket.h> #include <sys/syslog.h> @@ -65,8 +65,8 @@ #include <net/if.h> #include <net/if_types.h> -#include <net/intrq.h> #include <net/bpf.h> +#include <net/netisr.h> #include <netinet/in.h> @@ -729,6 +729,7 @@ ng_iface_rcvdata(hook_p hook, item_p item) const iffam_p iffam = get_iffam_from_hook(priv, hook); struct ifnet *const ifp = priv->ifp; struct mbuf *m; + int isr; NGI_GET_M(item, m); NG_FREE_ITEM(item); @@ -753,7 +754,51 @@ ng_iface_rcvdata(hook_p hook, item_p item) ng_iface_bpftap(ifp, m, iffam->family); /* Send packet */ - return family_enqueue(iffam->family, m); + switch (iffam->family) { +#ifdef INET + case AF_INET: + isr = NETISR_IP; + break; +#endif +#ifdef INET6 + case AF_INET6: + isr = NETISR_IPV6; + break; +#endif +#ifdef IPX + case AF_IPX: + isr = NETISR_IPX; + break; +#endif +#ifdef NS + case AF_NS: + isr = NETISR_NS; + break; +#endif +#ifdef NETATALK + case AF_APPLETALK: + isr = NETISR_ATALK2; + break; +#endif +#ifdef NATM + case AF_NATM: + isr = NETISR_NATM; + break; +#endif +#ifdef ATM_CORE + case AF_ATM: + isr = NETISR_ATM; + break; +#endif + default: + m_freem(m); + return (EAFNOSUPPORT); + } + /* First chunk of an mbuf contains good junk */ + if (harvest.point_to_point) + random_harvest(m, 16, 3, 0, RANDOM_NET); + netisr_dispatch(isr, m); + return (0); } /* diff --git a/sys/netgraph/ng_ip_input.c b/sys/netgraph/ng_ip_input.c index eb8a74d7ac056..bb24c6435fcbf 100644 --- a/sys/netgraph/ng_ip_input.c +++ b/sys/netgraph/ng_ip_input.c @@ -125,8 +125,7 @@ ngipi_rcvdata(hook_p hook, item_p item) NGI_GET_M(item, m); NG_FREE_ITEM(item); - schednetisr(NETISR_IP); - (void) IF_HANDOFF(&ipintrq, m, NULL); + netisr_dispatch(NETISR_IP, m); return 0; } |
