diff options
author | dm <dm@cvs.openbsd.org> | 1996-01-25 05:41:50 +0000 |
---|---|---|
committer | dm <dm@cvs.openbsd.org> | 1996-01-25 05:41:50 +0000 |
commit | d22510d35a65326e6c28cf24898e75ebb43f1702 (patch) | |
tree | 39d26580cbebbf88b26b3ce8999199204095ce79 /sys/netinet/ip_input.c | |
parent | 1dc3867108ccbee4e608e89a62fa5e5fbfa194c3 (diff) |
IP filter 3.0.1
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r-- | sys/netinet/ip_input.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 897583fcfb4..6b446c2780f 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -83,8 +83,7 @@ int ipqmaxlen = IFQ_MAXLEN; struct in_ifaddrhead in_ifaddr; struct ifqueue ipintrq; #if defined(IPFILTER) || defined(IPFILTER_LKM) -int fr_nullcheck(); -int (*fr_checkp) __P((struct ip *, int, struct ifnet *, int)) = fr_nullcheck; +int (*fr_checkp) __P((struct ip *, int, struct ifnet *, int, struct mbuf **)); #endif char * @@ -240,8 +239,13 @@ next: * Check if we want to allow this packet to be processed. * Consider it to be bad if not. */ - if ((*fr_checkp)(ip, hlen, m->m_pkthdr.rcvif, 0)) - goto bad; + { + struct mbuf *m0 = m; + if (fr_checkp && (*fr_checkp)(ip, hlen, m->m_pkthdr.rcvif, 0, &m0)) + goto next; + else + ip = mtod(m = m0, struct ip *); + } #endif /* * Process options and, if not destined for us, @@ -1185,10 +1189,3 @@ ip_sysctl(name, namelen, oldp, oldlenp, newp, newlen) } /* NOTREACHED */ } - -#if defined(IPFILTER) || defined(IPFILTER_LKM) -int fr_nullcheck() -{ - return 0; -} -#endif |