Deleted Added
full compact
1c1
< /* $FreeBSD: head/sys/netinet6/ip6_input.c 112130 2003-03-12 06:08:48Z sam $ */
---
> /* $FreeBSD: head/sys/netinet6/ip6_input.c 120386 2003-09-23 17:54:04Z sam $ */
145a146,148
> #ifdef PFIL_HOOKS
> struct pfil_head inet6_pfil_hook;
> #endif
186a190,196
> #ifdef PFIL_HOOKS
> inet6_pfil_hook.ph_type = PFIL_TYPE_AF;
> inet6_pfil_hook.ph_af = AF_INET6;
> if ((i = pfil_head_register(&inet6_pfil_hook)) != 0)
> printf("%s: WARNING: unable to register pfil hook, "
> "error %d\n", __func__, i);
> #endif /* PFIL_HOOKS */
244,248d253
< #ifdef PFIL_HOOKS
< struct packet_filter_hook *pfh;
< struct mbuf *m0;
< int rv;
< #endif /* PFIL_HOOKS */
343,347c348
< * Run through list of hooks for input packets. If there are any
< * filters which require that additional packets in the flow are
< * not fast-forwarded, they must clear the M_CANFASTFWD flag.
< * Note that filters must _never_ set this flag, as another filter
< * in the list may have previously cleared it.
---
> * Run through list of hooks for input packets.
349,361c350,354
< m0 = m;
< pfh = pfil_hook_get(PFIL_IN, &inet6sw[ip6_protox[IPPROTO_IPV6]].pr_pfh);
< for (; pfh; pfh = pfh->pfil_link.tqe_next)
< if (pfh->pfil_func) {
< rv = pfh->pfil_func(ip6, sizeof(*ip6),
< m->m_pkthdr.rcvif, 0, &m0);
< if (rv)
< return;
< m = m0;
< if (m == NULL)
< return;
< ip6 = mtod(m, struct ip6_hdr *);
< }
---
> if (pfil_run_hooks(&inet6_pfil_hook, &m, m->m_pkthdr.rcvif, PFIL_IN))
> return;
> if (m == NULL) /* consumed by filter */
> return;
> ip6 = mtod(m, struct ip6_hdr *);