]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/ipv4/netfilter/ip_conntrack_helper_pptp.c
[NETFILTER]: conntrack: add '_get' to {ip, nf}_conntrack_expect_find
[karo-tx-linux.git] / net / ipv4 / netfilter / ip_conntrack_helper_pptp.c
index b0225b65ca3518154ee33f69ffb57a8378f043e8..a5c057bcecf4efe00727bf7d8f9af9279686aca6 100644 (file)
@@ -142,7 +142,7 @@ static void pptp_expectfn(struct ip_conntrack *ct,
                DEBUGP("trying to unexpect other dir: ");
                DUMP_TUPLE(&inv_t);
 
-               exp_other = ip_conntrack_expect_find(&inv_t);
+               exp_other = ip_conntrack_expect_find_get(&inv_t);
                if (exp_other) {
                        /* delete other expectation.  */
                        DEBUGP("found\n");
@@ -176,7 +176,7 @@ static int destroy_sibling_or_exp(const struct ip_conntrack_tuple *t)
                ip_conntrack_put(sibling);
                return 1;
        } else {
-               exp = ip_conntrack_expect_find(t);
+               exp = ip_conntrack_expect_find_get(t);
                if (exp) {
                        DEBUGP("unexpect_related of expect %p\n", exp);
                        ip_conntrack_unexpect_related(exp);
@@ -194,6 +194,7 @@ static void pptp_destroy_siblings(struct ip_conntrack *ct)
 {
        struct ip_conntrack_tuple t;
 
+       ip_ct_gre_keymap_destroy(ct);
        /* Since ct->sibling_list has literally rusted away in 2.6.11,
         * we now need another way to find out about our sibling
         * contrack and expects... -HW */
@@ -241,10 +242,10 @@ exp_gre(struct ip_conntrack *ct,
        exp_orig->tuple.dst.u.gre.key = callid;
        exp_orig->tuple.dst.protonum = IPPROTO_GRE;
 
-       exp_orig->mask.src.ip = 0xffffffff;
+       exp_orig->mask.src.ip = htonl(0xffffffff);
        exp_orig->mask.src.u.all = 0;
        exp_orig->mask.dst.u.gre.key = htons(0xffff);
-       exp_orig->mask.dst.ip = 0xffffffff;
+       exp_orig->mask.dst.ip = htonl(0xffffffff);
        exp_orig->mask.dst.protonum = 0xff;
 
        exp_orig->master = ct;
@@ -552,15 +553,6 @@ conntrack_pptp_help(struct sk_buff **pskb,
        nexthdr_off += tcph->doff * 4;
        datalen = tcplen - tcph->doff * 4;
 
-       if (tcph->fin || tcph->rst) {
-               DEBUGP("RST/FIN received, timeouting GRE\n");
-               /* can't do this after real newnat */
-               info->cstate = PPTP_CALL_NONE;
-
-               /* untrack this call id, unexpect GRE packets */
-               pptp_destroy_siblings(ct);
-       }
-
        pptph = skb_header_pointer(*pskb, nexthdr_off, sizeof(_pptph), &_pptph);
        if (!pptph) {
                DEBUGP("no full PPTP header, can't track\n");
@@ -639,7 +631,8 @@ static struct ip_conntrack_helper pptp = {
                           .protonum = 0xff
                         }
                },
-       .help = conntrack_pptp_help
+       .help = conntrack_pptp_help,
+       .destroy = pptp_destroy_siblings,
 };
 
 extern void ip_ct_proto_gre_fini(void);