add pptp nat fix (should fix #571, needs to be tested)
authorFelix Fietkau <nbd@openwrt.org>
Tue, 5 Dec 2006 23:51:29 +0000 (23:51 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 5 Dec 2006 23:51:29 +0000 (23:51 +0000)
SVN-Revision: 5695

openwrt/target/linux/linux-2.4/patches/generic/103-netfilter_nat_pptp.patch

index 6c7d6e6f21f0567c0571da8a172609bb11ee3da6..ce2838f76a3ff72ea51db63817328b799211d85d 100644 (file)
@@ -1,6 +1,6 @@
-diff -urN linux-2.4.29-old/include/linux/netfilter_ipv4/ip_conntrack.h linux-2.4.29-dev/include/linux/netfilter_ipv4/ip_conntrack.h
---- linux-2.4.29-old/include/linux/netfilter_ipv4/ip_conntrack.h       2005-04-02 19:04:11.000000000 +0200
-+++ linux-2.4.29-dev/include/linux/netfilter_ipv4/ip_conntrack.h       2005-04-02 19:41:05.000000000 +0200
+diff -urN linux.old/include/linux/netfilter_ipv4/ip_conntrack.h linux.dev/include/linux/netfilter_ipv4/ip_conntrack.h
+--- linux.old/include/linux/netfilter_ipv4/ip_conntrack.h      2006-12-06 00:31:46.000000000 +0100
++++ linux.dev/include/linux/netfilter_ipv4/ip_conntrack.h      2006-12-06 00:34:27.000000000 +0100
 @@ -50,16 +50,19 @@
  
  #include <linux/netfilter_ipv4/ip_conntrack_tcp.h>
@@ -55,9 +55,9 @@ diff -urN linux-2.4.29-old/include/linux/netfilter_ipv4/ip_conntrack.h linux-2.4
  };
  #endif
  
-diff -urN linux-2.4.29-old/include/linux/netfilter_ipv4/ip_conntrack_pptp.h linux-2.4.29-dev/include/linux/netfilter_ipv4/ip_conntrack_pptp.h
---- linux-2.4.29-old/include/linux/netfilter_ipv4/ip_conntrack_pptp.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.29-dev/include/linux/netfilter_ipv4/ip_conntrack_pptp.h  2005-04-02 19:09:07.000000000 +0200
+diff -urN linux.old/include/linux/netfilter_ipv4/ip_conntrack_pptp.h linux.dev/include/linux/netfilter_ipv4/ip_conntrack_pptp.h
+--- linux.old/include/linux/netfilter_ipv4/ip_conntrack_pptp.h 1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/include/linux/netfilter_ipv4/ip_conntrack_pptp.h 2006-12-06 00:34:27.000000000 +0100
 @@ -0,0 +1,313 @@
 +/* PPTP constants and structs */
 +#ifndef _CONNTRACK_PPTP_H
@@ -372,9 +372,9 @@ diff -urN linux-2.4.29-old/include/linux/netfilter_ipv4/ip_conntrack_pptp.h linu
 +
 +#endif /* __KERNEL__ */
 +#endif /* _CONNTRACK_PPTP_H */
-diff -urN linux-2.4.29-old/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h linux-2.4.29-dev/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h
---- linux-2.4.29-old/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h     1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.29-dev/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h     2005-04-02 19:10:45.000000000 +0200
+diff -urN linux.old/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h linux.dev/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h
+--- linux.old/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h    1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h    2006-12-06 00:34:27.000000000 +0100
 @@ -0,0 +1,123 @@
 +#ifndef _CONNTRACK_PROTO_GRE_H
 +#define _CONNTRACK_PROTO_GRE_H
@@ -499,9 +499,9 @@ diff -urN linux-2.4.29-old/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h
 +#endif /* __KERNEL__ */
 +
 +#endif /* _CONNTRACK_PROTO_GRE_H */
-diff -urN linux-2.4.29-old/include/linux/netfilter_ipv4/ip_conntrack_tuple.h linux-2.4.29-dev/include/linux/netfilter_ipv4/ip_conntrack_tuple.h
---- linux-2.4.29-old/include/linux/netfilter_ipv4/ip_conntrack_tuple.h 2003-11-28 19:26:21.000000000 +0100
-+++ linux-2.4.29-dev/include/linux/netfilter_ipv4/ip_conntrack_tuple.h 2005-04-02 19:07:18.000000000 +0200
+diff -urN linux.old/include/linux/netfilter_ipv4/ip_conntrack_tuple.h linux.dev/include/linux/netfilter_ipv4/ip_conntrack_tuple.h
+--- linux.old/include/linux/netfilter_ipv4/ip_conntrack_tuple.h        2003-11-28 19:26:21.000000000 +0100
++++ linux.dev/include/linux/netfilter_ipv4/ip_conntrack_tuple.h        2006-12-06 00:34:27.000000000 +0100
 @@ -14,7 +14,7 @@
  union ip_conntrack_manip_proto
  {
@@ -560,9 +560,9 @@ diff -urN linux-2.4.29-old/include/linux/netfilter_ipv4/ip_conntrack_tuple.h lin
  
  #define CTINFO2DIR(ctinfo) ((ctinfo) >= IP_CT_IS_REPLY ? IP_CT_DIR_REPLY : IP_CT_DIR_ORIGINAL)
  
-diff -urN linux-2.4.29-old/include/linux/netfilter_ipv4/ip_nat_pptp.h linux-2.4.29-dev/include/linux/netfilter_ipv4/ip_nat_pptp.h
---- linux-2.4.29-old/include/linux/netfilter_ipv4/ip_nat_pptp.h        1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.29-dev/include/linux/netfilter_ipv4/ip_nat_pptp.h        2005-04-02 19:07:18.000000000 +0200
+diff -urN linux.old/include/linux/netfilter_ipv4/ip_nat_pptp.h linux.dev/include/linux/netfilter_ipv4/ip_nat_pptp.h
+--- linux.old/include/linux/netfilter_ipv4/ip_nat_pptp.h       1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/include/linux/netfilter_ipv4/ip_nat_pptp.h       2006-12-06 00:34:27.000000000 +0100
 @@ -0,0 +1,11 @@
 +/* PPTP constants and structs */
 +#ifndef _NAT_PPTP_H
@@ -575,9 +575,9 @@ diff -urN linux-2.4.29-old/include/linux/netfilter_ipv4/ip_nat_pptp.h linux-2.4.
 +};
 +
 +#endif /* _NAT_PPTP_H */
-diff -urN linux-2.4.29-old/net/ipv4/netfilter/Config.in linux-2.4.29-dev/net/ipv4/netfilter/Config.in
---- linux-2.4.29-old/net/ipv4/netfilter/Config.in      2005-04-02 19:04:11.000000000 +0200
-+++ linux-2.4.29-dev/net/ipv4/netfilter/Config.in      2005-04-02 19:07:18.000000000 +0200
+diff -urN linux.old/net/ipv4/netfilter/Config.in linux.dev/net/ipv4/netfilter/Config.in
+--- linux.old/net/ipv4/netfilter/Config.in     2006-12-06 00:31:46.000000000 +0100
++++ linux.dev/net/ipv4/netfilter/Config.in     2006-12-06 00:34:27.000000000 +0100
 @@ -10,6 +10,8 @@
    dep_tristate '  Amanda protocol support' CONFIG_IP_NF_AMANDA $CONFIG_IP_NF_CONNTRACK
    dep_tristate '  TFTP protocol support' CONFIG_IP_NF_TFTP $CONFIG_IP_NF_CONNTRACK
@@ -587,7 +587,7 @@ diff -urN linux-2.4.29-old/net/ipv4/netfilter/Config.in linux-2.4.29-dev/net/ipv
  fi
  
  if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-@@ -67,6 +69,20 @@
+@@ -64,6 +66,20 @@
        define_bool CONFIG_IP_NF_NAT_NEEDED y
        dep_tristate '    MASQUERADE target support' CONFIG_IP_NF_TARGET_MASQUERADE $CONFIG_IP_NF_NAT
        dep_tristate '    REDIRECT target support' CONFIG_IP_NF_TARGET_REDIRECT $CONFIG_IP_NF_NAT
@@ -608,10 +608,10 @@ diff -urN linux-2.4.29-old/net/ipv4/netfilter/Config.in linux-2.4.29-dev/net/ipv
        if [ "$CONFIG_IP_NF_AMANDA" = "m" ]; then
          define_tristate CONFIG_IP_NF_NAT_AMANDA m
        else
-diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_conntrack_core.c linux-2.4.29-dev/net/ipv4/netfilter/ip_conntrack_core.c
---- linux-2.4.29-old/net/ipv4/netfilter/ip_conntrack_core.c    2005-04-02 19:04:11.000000000 +0200
-+++ linux-2.4.29-dev/net/ipv4/netfilter/ip_conntrack_core.c    2005-04-02 19:07:18.000000000 +0200
-@@ -142,6 +142,8 @@
+diff -urN linux.old/net/ipv4/netfilter/ip_conntrack_core.c linux.dev/net/ipv4/netfilter/ip_conntrack_core.c
+--- linux.old/net/ipv4/netfilter/ip_conntrack_core.c   2006-12-06 00:31:46.000000000 +0100
++++ linux.dev/net/ipv4/netfilter/ip_conntrack_core.c   2006-12-06 00:34:27.000000000 +0100
+@@ -143,6 +143,8 @@
        tuple->dst.ip = iph->daddr;
        tuple->dst.protonum = iph->protocol;
  
@@ -620,7 +620,7 @@ diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_conntrack_core.c linux-2.4.29-d
        ret = protocol->pkt_to_tuple((u_int32_t *)iph + iph->ihl,
                                     len - 4*iph->ihl,
                                     tuple);
-@@ -157,6 +159,8 @@
+@@ -158,6 +160,8 @@
        inverse->dst.ip = orig->src.ip;
        inverse->dst.protonum = orig->dst.protonum;
  
@@ -629,7 +629,7 @@ diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_conntrack_core.c linux-2.4.29-d
        return protocol->invert_tuple(inverse, orig);
  }
  
-@@ -954,8 +958,8 @@
+@@ -970,8 +974,8 @@
         * so there is no need to use the tuple lock too */
  
        DEBUGP("ip_conntrack_expect_related %p\n", related_to);
@@ -640,7 +640,7 @@ diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_conntrack_core.c linux-2.4.29-d
  
        old = LIST_FIND(&ip_conntrack_expect_list, resent_expect,
                        struct ip_conntrack_expect *, &expect->tuple, 
-@@ -1072,15 +1076,14 @@
+@@ -1089,15 +1093,14 @@
  
        MUST_BE_READ_LOCKED(&ip_conntrack_lock);
        WRITE_LOCK(&ip_conntrack_expect_tuple_lock);
@@ -660,9 +660,9 @@ diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_conntrack_core.c linux-2.4.29-d
                    && LIST_FIND(&ip_conntrack_expect_list, expect_clash,
                                 struct ip_conntrack_expect *, newtuple, &expect->mask)) {
                        /* Force NAT to find an unused tuple */
-diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_conntrack_pptp.c linux-2.4.29-dev/net/ipv4/netfilter/ip_conntrack_pptp.c
---- linux-2.4.29-old/net/ipv4/netfilter/ip_conntrack_pptp.c    1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.29-dev/net/ipv4/netfilter/ip_conntrack_pptp.c    2005-04-02 19:13:21.000000000 +0200
+diff -urN linux.old/net/ipv4/netfilter/ip_conntrack_pptp.c linux.dev/net/ipv4/netfilter/ip_conntrack_pptp.c
+--- linux.old/net/ipv4/netfilter/ip_conntrack_pptp.c   1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/net/ipv4/netfilter/ip_conntrack_pptp.c   2006-12-06 00:34:27.000000000 +0100
 @@ -0,0 +1,633 @@
 +/*
 + * ip_conntrack_pptp.c        - Version 1.9
@@ -1297,9 +1297,9 @@ diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_conntrack_pptp.c linux-2.4.29-d
 +module_exit(fini);
 +
 +EXPORT_SYMBOL(ip_pptp_lock);
-diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_conntrack_pptp_priv.h linux-2.4.29-dev/net/ipv4/netfilter/ip_conntrack_pptp_priv.h
---- linux-2.4.29-old/net/ipv4/netfilter/ip_conntrack_pptp_priv.h       1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.29-dev/net/ipv4/netfilter/ip_conntrack_pptp_priv.h       2005-04-02 19:14:10.000000000 +0200
+diff -urN linux.old/net/ipv4/netfilter/ip_conntrack_pptp_priv.h linux.dev/net/ipv4/netfilter/ip_conntrack_pptp_priv.h
+--- linux.old/net/ipv4/netfilter/ip_conntrack_pptp_priv.h      1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/net/ipv4/netfilter/ip_conntrack_pptp_priv.h      2006-12-06 00:34:27.000000000 +0100
 @@ -0,0 +1,24 @@
 +#ifndef _IP_CT_PPTP_PRIV_H
 +#define _IP_CT_PPTP_PRIV_H
@@ -1325,9 +1325,9 @@ diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_conntrack_pptp_priv.h linux-2.4
 +};
 +
 +#endif
-diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_conntrack_proto_gre.c linux-2.4.29-dev/net/ipv4/netfilter/ip_conntrack_proto_gre.c
---- linux-2.4.29-old/net/ipv4/netfilter/ip_conntrack_proto_gre.c       1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.29-dev/net/ipv4/netfilter/ip_conntrack_proto_gre.c       2005-04-02 19:14:31.000000000 +0200
+diff -urN linux.old/net/ipv4/netfilter/ip_conntrack_proto_gre.c linux.dev/net/ipv4/netfilter/ip_conntrack_proto_gre.c
+--- linux.old/net/ipv4/netfilter/ip_conntrack_proto_gre.c      1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/net/ipv4/netfilter/ip_conntrack_proto_gre.c      2006-12-06 00:34:27.000000000 +0100
 @@ -0,0 +1,333 @@
 +/*
 + * ip_conntrack_proto_gre.c - Version 1.2 
@@ -1662,9 +1662,9 @@ diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_conntrack_proto_gre.c linux-2.4
 +
 +module_init(init);
 +module_exit(fini);
-diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_nat_core.c linux-2.4.29-dev/net/ipv4/netfilter/ip_nat_core.c
---- linux-2.4.29-old/net/ipv4/netfilter/ip_nat_core.c  2005-01-19 15:10:13.000000000 +0100
-+++ linux-2.4.29-dev/net/ipv4/netfilter/ip_nat_core.c  2005-04-02 19:07:18.000000000 +0200
+diff -urN linux.old/net/ipv4/netfilter/ip_nat_core.c linux.dev/net/ipv4/netfilter/ip_nat_core.c
+--- linux.old/net/ipv4/netfilter/ip_nat_core.c 2005-04-04 03:42:20.000000000 +0200
++++ linux.dev/net/ipv4/netfilter/ip_nat_core.c 2006-12-06 00:34:27.000000000 +0100
 @@ -424,7 +424,7 @@
        *tuple = *orig_tuple;
        while ((rptr = find_best_ips_proto_fast(tuple, mr, conntrack, hooknum))
@@ -1686,10 +1686,10 @@ diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_nat_core.c linux-2.4.29-dev/net
  #endif
  
                /* We now have two tuples (SRCIP/SRCPT/DSTIP/DSTPT):
-diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_nat_pptp.c linux-2.4.29-dev/net/ipv4/netfilter/ip_nat_pptp.c
---- linux-2.4.29-old/net/ipv4/netfilter/ip_nat_pptp.c  1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.29-dev/net/ipv4/netfilter/ip_nat_pptp.c  2005-04-02 19:14:52.000000000 +0200
-@@ -0,0 +1,475 @@
+diff -urN linux.old/net/ipv4/netfilter/ip_nat_pptp.c linux.dev/net/ipv4/netfilter/ip_nat_pptp.c
+--- linux.old/net/ipv4/netfilter/ip_nat_pptp.c 1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/net/ipv4/netfilter/ip_nat_pptp.c 2006-12-06 00:34:38.000000000 +0100
+@@ -0,0 +1,482 @@
 +/*
 + * ip_nat_pptp.c      - Version 1.5
 + *
@@ -1978,8 +1978,12 @@ diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_nat_pptp.c linux-2.4.29-dev/net
 +              } else {
 +                      DEBUGP("can't change expect\n");
 +              }
-+              ip_ct_gre_keymap_change(oldexp->proto.gre.keymap_orig, &t);
-+              ip_ct_gre_keymap_change(oldexp->proto.gre.keymap_reply, &inv_t);
++              if (oldexp->proto.gre.keymap_orig)
++                      ip_ct_gre_keymap_change(oldexp->proto.gre.keymap_orig, 
++                                              &t);
++              if (oldexp->proto.gre.keymap_reply)
++                      ip_ct_gre_keymap_change(oldexp->proto.gre.keymap_reply, 
++                                              &inv_t);
 +              break;
 +      case PPTP_IN_CALL_CONNECT:
 +              pcid = &pptpReq.iccon->peersCallID;
@@ -2012,6 +2016,9 @@ diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_nat_pptp.c linux-2.4.29-dev/net
 +      case PPTP_CALL_DISCONNECT_NOTIFY:
 +              pcid = &pptpReq.disc->callID;
 +              break;
++      case PPTP_SET_LINK_INFO:
++              pcid = &pptpReq.setlink->peersCallID;
++              break;
 +
 +      default:
 +              DEBUGP("unknown inbound packet %s\n",
@@ -2165,10 +2172,9 @@ diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_nat_pptp.c linux-2.4.29-dev/net
 +
 +module_init(init);
 +module_exit(fini);
-Binary files linux-2.4.29-old/net/ipv4/netfilter/.ip_nat_pptp.c.swp and linux-2.4.29-dev/net/ipv4/netfilter/.ip_nat_pptp.c.swp differ
-diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_nat_proto_gre.c linux-2.4.29-dev/net/ipv4/netfilter/ip_nat_proto_gre.c
---- linux-2.4.29-old/net/ipv4/netfilter/ip_nat_proto_gre.c     1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.29-dev/net/ipv4/netfilter/ip_nat_proto_gre.c     2005-04-02 19:15:10.000000000 +0200
+diff -urN linux.old/net/ipv4/netfilter/ip_nat_proto_gre.c linux.dev/net/ipv4/netfilter/ip_nat_proto_gre.c
+--- linux.old/net/ipv4/netfilter/ip_nat_proto_gre.c    1970-01-01 01:00:00.000000000 +0100
++++ linux.dev/net/ipv4/netfilter/ip_nat_proto_gre.c    2006-12-06 00:34:27.000000000 +0100
 @@ -0,0 +1,202 @@
 +/*
 + * ip_nat_proto_gre.c - Version 1.2
@@ -2372,9 +2378,9 @@ diff -urN linux-2.4.29-old/net/ipv4/netfilter/ip_nat_proto_gre.c linux-2.4.29-de
 +
 +module_init(init);
 +module_exit(fini);
-diff -urN linux-2.4.29-old/net/ipv4/netfilter/Makefile linux-2.4.29-dev/net/ipv4/netfilter/Makefile
---- linux-2.4.29-old/net/ipv4/netfilter/Makefile       2005-04-02 19:04:11.000000000 +0200
-+++ linux-2.4.29-dev/net/ipv4/netfilter/Makefile       2005-04-02 19:07:18.000000000 +0200
+diff -urN linux.old/net/ipv4/netfilter/Makefile linux.dev/net/ipv4/netfilter/Makefile
+--- linux.old/net/ipv4/netfilter/Makefile      2006-12-06 00:31:46.000000000 +0100
++++ linux.dev/net/ipv4/netfilter/Makefile      2006-12-06 00:34:27.000000000 +0100
 @@ -36,23 +36,32 @@
  ifdef CONFIG_IP_NF_AMANDA
        export-objs += ip_conntrack_amanda.o