]> err.no Git - linux-2.6/blobdiff - net/netfilter/nf_conntrack_h323_main.c
netfilter: nf_conntrack_tcp: fix endless loop
[linux-2.6] / net / netfilter / nf_conntrack_h323_main.c
index c3f87094de43bb82d73a56e01cd5dfaf6d8cd35f..2f83c158934d4ba5350d63aa86d6ff90ae99d585 100644 (file)
@@ -303,9 +303,9 @@ static int expect_rtp_rtcp(struct sk_buff *skb, struct nf_conn *ct,
                if (nf_ct_expect_related(rtp_exp) == 0) {
                        if (nf_ct_expect_related(rtcp_exp) == 0) {
                                pr_debug("nf_ct_h323: expect RTP ");
-                               NF_CT_DUMP_TUPLE(&rtp_exp->tuple);
+                               nf_ct_dump_tuple(&rtp_exp->tuple);
                                pr_debug("nf_ct_h323: expect RTCP ");
-                               NF_CT_DUMP_TUPLE(&rtcp_exp->tuple);
+                               nf_ct_dump_tuple(&rtcp_exp->tuple);
                        } else {
                                nf_ct_unexpect_related(rtp_exp);
                                ret = -1;
@@ -360,7 +360,7 @@ static int expect_t120(struct sk_buff *skb,
        } else {                /* Conntrack only */
                if (nf_ct_expect_related(exp) == 0) {
                        pr_debug("nf_ct_h323: expect T.120 ");
-                       NF_CT_DUMP_TUPLE(&exp->tuple);
+                       nf_ct_dump_tuple(&exp->tuple);
                } else
                        ret = -1;
        }
@@ -582,7 +582,7 @@ static int h245_help(struct sk_buff *skb, unsigned int protoff,
        while (get_tpkt_data(skb, protoff, ct, ctinfo,
                             &data, &datalen, &dataoff)) {
                pr_debug("nf_ct_h245: TPKT len=%d ", datalen);
-               NF_CT_DUMP_TUPLE(&ct->tuplehash[CTINFO2DIR(ctinfo)].tuple);
+               nf_ct_dump_tuple(&ct->tuplehash[CTINFO2DIR(ctinfo)].tuple);
 
                /* Decode H.245 signal */
                ret = DecodeMultimediaSystemControlMessage(data, datalen,
@@ -619,6 +619,7 @@ static const struct nf_conntrack_expect_policy h245_exp_policy = {
 static struct nf_conntrack_helper nf_conntrack_helper_h245 __read_mostly = {
        .name                   = "H.245",
        .me                     = THIS_MODULE,
+       .tuple.src.l3num        = AF_UNSPEC,
        .tuple.dst.protonum     = IPPROTO_UDP,
        .help                   = h245_help,
        .expect_policy          = &h245_exp_policy,
@@ -695,7 +696,7 @@ static int expect_h245(struct sk_buff *skb, struct nf_conn *ct,
        } else {                /* Conntrack only */
                if (nf_ct_expect_related(exp) == 0) {
                        pr_debug("nf_ct_q931: expect H.245 ");
-                       NF_CT_DUMP_TUPLE(&exp->tuple);
+                       nf_ct_dump_tuple(&exp->tuple);
                } else
                        ret = -1;
        }
@@ -810,7 +811,7 @@ static int expect_callforwarding(struct sk_buff *skb,
        } else {                /* Conntrack only */
                if (nf_ct_expect_related(exp) == 0) {
                        pr_debug("nf_ct_q931: expect Call Forwarding ");
-                       NF_CT_DUMP_TUPLE(&exp->tuple);
+                       nf_ct_dump_tuple(&exp->tuple);
                } else
                        ret = -1;
        }
@@ -1130,7 +1131,7 @@ static int q931_help(struct sk_buff *skb, unsigned int protoff,
        while (get_tpkt_data(skb, protoff, ct, ctinfo,
                             &data, &datalen, &dataoff)) {
                pr_debug("nf_ct_q931: TPKT len=%d ", datalen);
-               NF_CT_DUMP_TUPLE(&ct->tuplehash[CTINFO2DIR(ctinfo)].tuple);
+               nf_ct_dump_tuple(&ct->tuplehash[CTINFO2DIR(ctinfo)].tuple);
 
                /* Decode Q.931 signal */
                ret = DecodeQ931(data, datalen, &q931);
@@ -1279,7 +1280,7 @@ static int expect_q931(struct sk_buff *skb, struct nf_conn *ct,
        } else {                /* Conntrack only */
                if (nf_ct_expect_related(exp) == 0) {
                        pr_debug("nf_ct_ras: expect Q.931 ");
-                       NF_CT_DUMP_TUPLE(&exp->tuple);
+                       nf_ct_dump_tuple(&exp->tuple);
 
                        /* Save port for looking up expect in processing RCF */
                        info->sig_port[dir] = port;
@@ -1343,7 +1344,7 @@ static int process_gcf(struct sk_buff *skb, struct nf_conn *ct,
 
        if (nf_ct_expect_related(exp) == 0) {
                pr_debug("nf_ct_ras: expect RAS ");
-               NF_CT_DUMP_TUPLE(&exp->tuple);
+               nf_ct_dump_tuple(&exp->tuple);
        } else
                ret = -1;
 
@@ -1427,7 +1428,7 @@ static int process_rcf(struct sk_buff *skb, struct nf_conn *ct,
                        pr_debug("nf_ct_ras: set Q.931 expect "
                                 "timeout to %u seconds for",
                                 info->timeout);
-                       NF_CT_DUMP_TUPLE(&exp->tuple);
+                       nf_ct_dump_tuple(&exp->tuple);
                        set_expect_timeout(exp, info->timeout);
                }
                spin_unlock_bh(&nf_conntrack_lock);
@@ -1548,7 +1549,7 @@ static int process_acf(struct sk_buff *skb, struct nf_conn *ct,
 
        if (nf_ct_expect_related(exp) == 0) {
                pr_debug("nf_ct_ras: expect Q.931 ");
-               NF_CT_DUMP_TUPLE(&exp->tuple);
+               nf_ct_dump_tuple(&exp->tuple);
        } else
                ret = -1;
 
@@ -1601,7 +1602,7 @@ static int process_lcf(struct sk_buff *skb, struct nf_conn *ct,
 
        if (nf_ct_expect_related(exp) == 0) {
                pr_debug("nf_ct_ras: expect Q.931 ");
-               NF_CT_DUMP_TUPLE(&exp->tuple);
+               nf_ct_dump_tuple(&exp->tuple);
        } else
                ret = -1;
 
@@ -1705,7 +1706,7 @@ static int ras_help(struct sk_buff *skb, unsigned int protoff,
        if (data == NULL)
                goto accept;
        pr_debug("nf_ct_ras: RAS message len=%d ", datalen);
-       NF_CT_DUMP_TUPLE(&ct->tuplehash[CTINFO2DIR(ctinfo)].tuple);
+       nf_ct_dump_tuple(&ct->tuplehash[CTINFO2DIR(ctinfo)].tuple);
 
        /* Decode RAS message */
        ret = DecodeRasMessage(data, datalen, &ras);
@@ -1765,6 +1766,7 @@ static void __exit nf_conntrack_h323_fini(void)
        nf_conntrack_helper_unregister(&nf_conntrack_helper_ras[0]);
        nf_conntrack_helper_unregister(&nf_conntrack_helper_q931[1]);
        nf_conntrack_helper_unregister(&nf_conntrack_helper_q931[0]);
+       nf_conntrack_helper_unregister(&nf_conntrack_helper_h245);
        kfree(h323_buffer);
        pr_debug("nf_ct_h323: fini\n");
 }
@@ -1777,28 +1779,34 @@ static int __init nf_conntrack_h323_init(void)
        h323_buffer = kmalloc(65536, GFP_KERNEL);
        if (!h323_buffer)
                return -ENOMEM;
-       ret = nf_conntrack_helper_register(&nf_conntrack_helper_q931[0]);
+       ret = nf_conntrack_helper_register(&nf_conntrack_helper_h245);
        if (ret < 0)
                goto err1;
-       ret = nf_conntrack_helper_register(&nf_conntrack_helper_q931[1]);
+       ret = nf_conntrack_helper_register(&nf_conntrack_helper_q931[0]);
        if (ret < 0)
                goto err2;
-       ret = nf_conntrack_helper_register(&nf_conntrack_helper_ras[0]);
+       ret = nf_conntrack_helper_register(&nf_conntrack_helper_q931[1]);
        if (ret < 0)
                goto err3;
-       ret = nf_conntrack_helper_register(&nf_conntrack_helper_ras[1]);
+       ret = nf_conntrack_helper_register(&nf_conntrack_helper_ras[0]);
        if (ret < 0)
                goto err4;
+       ret = nf_conntrack_helper_register(&nf_conntrack_helper_ras[1]);
+       if (ret < 0)
+               goto err5;
        pr_debug("nf_ct_h323: init success\n");
        return 0;
 
-err4:
+err5:
        nf_conntrack_helper_unregister(&nf_conntrack_helper_ras[0]);
-err3:
+err4:
        nf_conntrack_helper_unregister(&nf_conntrack_helper_q931[1]);
-err2:
+err3:
        nf_conntrack_helper_unregister(&nf_conntrack_helper_q931[0]);
+err2:
+       nf_conntrack_helper_unregister(&nf_conntrack_helper_h245);
 err1:
+       kfree(h323_buffer);
        return ret;
 }