summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_input.c
diff options
context:
space:
mode:
authordarrenr <darrenr@NetBSD.org>2000-02-17 10:59:32 +0000
committerdarrenr <darrenr@NetBSD.org>2000-02-17 10:59:32 +0000
commitfd7edad6c38dd58a486169a70249f2d366ca44dc (patch)
tree404fb15bb4c55272991878d69ba66476f06440d3 /sys/netinet/ip_input.c
parent376d66b867dba7acc4137c86bacbf8958cd03b68 (diff)
Change the use of pfil hooks. There is no longer a single list of all
pfil information, instead, struct protosw now contains a structure which caontains list heads, etc. The per-protosw pfil struct is passed to pfil_hook_get(), along with an in/out flag to get the head of the relevant filter list. This has been done for only IPv4 and IPv6, at present, with these patches only enabling filtering for IPPROTO_IP and IPPROTO_IPV6, although it is possible to have tcp/udp, etc, dedicated filters now also. The ipfilter code has been updated to only filter IPv4 packets - next major release of ipfilter is required for ipv6.
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r--sys/netinet/ip_input.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index c51f109210a..a75b8bf3145 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_input.c,v 1.100 2000/02/16 12:40:40 itojun Exp $ */
+/* $NetBSD: ip_input.c,v 1.101 2000/02/17 10:59:35 darrenr Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -194,8 +194,6 @@ int ipprintfs = 0;
struct rttimer_queue *ip_mtudisc_timeout_q = NULL;
extern struct domain inetdomain;
-extern struct protosw inetsw[];
-u_char ip_protox[IPPROTO_MAX];
int ipqmaxlen = IFQ_MAXLEN;
struct in_ifaddrhead in_ifaddr;
struct in_ifaddrhashhead *in_ifaddrhashtbl;
@@ -466,9 +464,11 @@ ip_input(struct mbuf *m)
* in the list may have previously cleared it.
*/
m0 = m;
- for (pfh = pfil_hook_get(PFIL_IN); pfh; pfh = pfh->pfil_link.tqe_next)
+ pfh = pfil_hook_get(PFIL_IN, &inetsw[ip_protox[IPPROTO_IP]]);
+ for (; pfh; pfh = pfh->pfil_link.tqe_next)
if (pfh->pfil_func) {
- rv = pfh->pfil_func(ip, hlen, m->m_pkthdr.rcvif, 0, &m0);
+ rv = pfh->pfil_func(ip, hlen,
+ m->m_pkthdr.rcvif, 0, &m0);
if (rv)
return;
m = m0;