Initial import from FreeBSD RELENG_4:
[games.git] / contrib / ipfilter / FreeBSD-2.2 / ip_output.c.diffs
1 *** /sys/netinet/ip_output.c.orig       Sat May 24 14:07:24 1997
2 --- /sys/netinet/ip_output.c    Sat May 24 15:00:29 1997
3 ***************
4 *** 67,72 ****
5 --- 67,76 ----
6   #else
7   #undef COMPAT_IPFW
8   #endif
9 + #if defined(IPFILTER_LKM) || defined(IPFILTER)
10 + extern        int     (*fr_checkp) __P((struct ip *, int, struct ifnet *, int, struct mbuf **));
11 + #endif
12
13   
14   u_short ip_id;
15   
16 ***************
17 *** 75,81 ****
18         __P((struct ifnet *, struct mbuf *, struct sockaddr_in *));
19   static int    ip_getmoptions
20         __P((int, struct ip_moptions *, struct mbuf **));
21 ! static int    ip_optcopy __P((struct ip *, struct ip *));
22   static int    ip_pcbopts __P((struct mbuf **, struct mbuf *));
23   static int    ip_setmoptions
24         __P((int, struct ip_moptions **, struct mbuf *));
25 --- 79,85 ----
26         __P((struct ifnet *, struct mbuf *, struct sockaddr_in *));
27   static int    ip_getmoptions
28         __P((int, struct ip_moptions *, struct mbuf **));
29 ! int   ip_optcopy __P((struct ip *, struct ip *));
30   static int    ip_pcbopts __P((struct mbuf **, struct mbuf *));
31   static int    ip_setmoptions
32         __P((int, struct ip_moptions **, struct mbuf *));
33 ***************
34 *** 338,343 ****
35 --- 342,356 ----
36          * - Wrap: fake packet's addr/port <unimpl.>
37          * - Encapsulate: put it in another IP and send out. <unimp.>
38          */ 
39 + #if defined(IPFILTER_LKM) || defined(IPFILTER)
40 +       if (fr_checkp) {
41 +               struct mbuf *m1 = m;
42
43 +               if ((error = (*fr_checkp)(ip, hlen, ifp, 1, &m1)) || !m1)
44 +                       goto done;
45 +               ip = mtod(m = m1, struct ip *);
46 +       }
47 + #endif
48   
49   #ifdef COMPAT_IPFW
50           if (ip_nat_ptr && !(*ip_nat_ptr)(&ip, &m, ifp, IP_NAT_OUT)) {
51 ***************
52 *** 559,565 ****
53    * Copy options from ip to jp,
54    * omitting those not copied during fragmentation.
55    */
56 ! static int
57   ip_optcopy(ip, jp)
58         struct ip *ip, *jp;
59   {
60 --- 574,580 ----
61    * Copy options from ip to jp,
62    * omitting those not copied during fragmentation.
63    */
64 ! int
65   ip_optcopy(ip, jp)
66         struct ip *ip, *jp;
67   {