]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/ipfilter/FreeBSD-4.0/ipv6-patch
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / ipfilter / FreeBSD-4.0 / ipv6-patch
1 *** ip6_input.c.orig    Sun Feb 13 14:32:01 2000
2 --- ip6_input.c Wed Apr 26 22:31:34 2000
3 ***************
4 *** 121,126 ****
5 --- 121,127 ----
6   
7   extern struct domain inet6domain;
8   extern struct ip6protosw inet6sw[];
9 + extern int (*fr_checkp) __P((struct ip *, int, struct ifnet *, int, struct mbuf **));
10   
11   u_char        ip6_protox[IPPROTO_MAX];
12   static int    ip6qmaxlen = IFQ_MAXLEN;
13 ***************
14 *** 302,307 ****
15 --- 303,317 ----
16                 ip6stat.ip6s_badvers++;
17                 in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_hdrerr);
18                 goto bad;
19 +       }
20
21 +       if (fr_checkp) {
22 +               struct  mbuf    *m1 = m;
23
24 +               if ((*fr_checkp)(ip6, sizeof(*ip6), m->m_pkthdr.rcvif,
25 +                                0, &m1) || !m1)
26 +                       return;
27 +               ip6 = mtod(m = m1, struct ip6_hdr *);
28         }
29   
30         ip6stat.ip6s_nxthist[ip6->ip6_nxt]++;
31 *** ip6_output.c.orig   Fri Mar 10 01:57:16 2000
32 --- ip6_output.c        Wed Apr 26 22:34:34 2000
33 ***************
34 *** 108,113 ****
35 --- 108,115 ----
36   #include <netinet6/ip6_fw.h>
37   #endif
38   
39 + extern int (*fr_checkp) __P((struct ip *, int, struct ifnet *, int, struct mbuf **));
40
41   static MALLOC_DEFINE(M_IPMOPTS, "ip6_moptions", "internet multicast options");
42   
43   struct ip6_exthdrs {
44 ***************
45 *** 754,759 ****
46 --- 756,770 ----
47                         ip6->ip6_src.s6_addr16[1] = 0;
48                 if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_dst))
49                         ip6->ip6_dst.s6_addr16[1] = 0;
50 +       }
51
52 +       if (fr_checkp) {
53 +               struct  mbuf    *m1 = m;
54
55 +               if ((error = (*fr_checkp)(ip6, sizeof(*ip6), ifp, 1, &m1)) ||
56 +                   !m1)
57 +                       goto done;
58 +               ip6 = mtod(m = m1, struct ip6_hdr *);
59         }
60   
61   #ifdef IPV6FIREWALL