]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[NETFILTER]: nf_conntrack: replace NF_CT_DUMP_TUPLE macro indrection by function...
authorJan Engelhardt <jengelh@computergmbh.de>
Mon, 14 Apr 2008 09:15:54 +0000 (11:15 +0200)
committerPatrick McHardy <kaber@trash.net>
Mon, 14 Apr 2008 09:15:54 +0000 (11:15 +0200)
Directly call IPv4 and IPv6 variants where the address family is
easily known.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
12 files changed:
include/net/netfilter/nf_conntrack_tuple.h
net/ipv4/netfilter/ipt_CLUSTERIP.c
net/ipv4/netfilter/nf_conntrack_proto_icmp.c
net/ipv4/netfilter/nf_nat_pptp.c
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_h323_main.c
net/netfilter/nf_conntrack_pptp.c
net/netfilter/nf_conntrack_proto_gre.c
net/netfilter/nf_conntrack_proto_tcp.c
net/netfilter/nf_conntrack_sane.c
net/netfilter/nf_conntrack_tftp.c

index 2722b13ecd6c4f55f55bae1cbe705f5348432dab..1bb7087833d374eb2429dd55318248ddc1747d50 100644 (file)
@@ -151,8 +151,6 @@ static inline void nf_ct_dump_tuple(const struct nf_conntrack_tuple *t)
        }
 }
 
-#define NF_CT_DUMP_TUPLE(tp)   nf_ct_dump_tuple(tp)
-
 /* If we're the first tuple, it's the original dir. */
 #define NF_CT_DIRECTION(h)                                             \
        ((enum ip_conntrack_dir)(h)->tuple.dst.dir)
index 2510d4fcdb5477aed31047e4983347c859055f27..c1f970cb7221b927fffecd66bce6197d76c9660a 100644 (file)
@@ -331,7 +331,7 @@ clusterip_tg(struct sk_buff *skb, const struct net_device *in,
        }
 
 #ifdef DEBUG
-       NF_CT_DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
+       nf_ct_dump_tuple_ip(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
 #endif
        pr_debug("hash=%u ct_hash=%u ", hash, ct->mark);
        if (!clusterip_responsible(cipinfo->config, hash)) {
index 193a845fe7f84d9e4bf758c13216e00f7aa73c72..78ab19accace2ee84e282c534250920fad82ebce 100644 (file)
@@ -115,7 +115,7 @@ static bool icmp_new(struct nf_conn *ct, const struct sk_buff *skb,
                /* Can't create a new ICMP `conn' with this. */
                pr_debug("icmp: can't create new conn with type %u\n",
                         ct->tuplehash[0].tuple.dst.u.icmp.type);
-               NF_CT_DUMP_TUPLE(&ct->tuplehash[0].tuple);
+               nf_ct_dump_tuple_ip(&ct->tuplehash[0].tuple);
                return false;
        }
        atomic_set(&ct->proto.icmp.count, 0);
index 3a1e6d6afc0af3d8d2a7fda4cfc4a9e7bf290994..da3d91a5ef5ce70588732dabbcd5d8b613266e8c 100644 (file)
@@ -72,7 +72,7 @@ static void pptp_nat_expected(struct nf_conn *ct,
        }
 
        pr_debug("trying to unexpect other dir: ");
-       NF_CT_DUMP_TUPLE(&t);
+       nf_ct_dump_tuple_ip(&t);
        other_exp = nf_ct_expect_find_get(&t);
        if (other_exp) {
                nf_ct_unexpect_related(other_exp);
index 9ad40e0e17fcccbc5be7277cea53f605e9fb8da9..ee713b03e9ec81f252dc0b45a499a2769583ba55 100644 (file)
@@ -115,7 +115,7 @@ static bool icmpv6_new(struct nf_conn *ct, const struct sk_buff *skb,
                /* Can't create a new ICMPv6 `conn' with this. */
                pr_debug("icmpv6: can't create new conn with type %u\n",
                         type + 128);
-               NF_CT_DUMP_TUPLE(&ct->tuplehash[0].tuple);
+               nf_ct_dump_tuple_ipv6(&ct->tuplehash[0].tuple);
                return false;
        }
        atomic_set(&ct->proto.icmp.count, 0);
index a3fe9db412d33d880697e678fbf8c463d385fdfc..351237399e27aef463914f728f191edb98be357a 100644 (file)
@@ -763,7 +763,7 @@ void nf_conntrack_alter_reply(struct nf_conn *ct,
        NF_CT_ASSERT(!nf_ct_is_confirmed(ct));
 
        pr_debug("Altering reply tuple of %p to ", ct);
-       NF_CT_DUMP_TUPLE(newreply);
+       nf_ct_dump_tuple(newreply);
 
        ct->tuplehash[IP_CT_DIR_REPLY].tuple = *newreply;
        if (ct->master || (help && help->expecting != 0))
index c3f87094de43bb82d73a56e01cd5dfaf6d8cd35f..95da1a24aab786e31eecd1a983a67faa81b44de0 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,
@@ -695,7 +695,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 +810,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 +1130,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 +1279,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 +1343,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 +1427,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 +1548,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 +1601,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 +1705,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);
index 4793cc07878918530fc88f9ccf58103450f788c7..97e54b0e43a3a1825f58d4ec42d5bbf6aab0e2c4 100644 (file)
@@ -119,7 +119,7 @@ static void pptp_expectfn(struct nf_conn *ct,
                /* obviously this tuple inversion only works until you do NAT */
                nf_ct_invert_tuplepr(&inv_t, &exp->tuple);
                pr_debug("trying to unexpect other dir: ");
-               NF_CT_DUMP_TUPLE(&inv_t);
+               nf_ct_dump_tuple(&inv_t);
 
                exp_other = nf_ct_expect_find_get(&inv_t);
                if (exp_other) {
@@ -141,7 +141,7 @@ static int destroy_sibling_or_exp(const struct nf_conntrack_tuple *t)
        struct nf_conn *sibling;
 
        pr_debug("trying to timeout ct or exp for tuple ");
-       NF_CT_DUMP_TUPLE(t);
+       nf_ct_dump_tuple(t);
 
        h = nf_conntrack_find_get(t);
        if (h)  {
index 7d37a2ea67b25c2dbe444c04ca439ea55085a891..654a4f7f12c6f7f74c1412ad432c95661336fcdb 100644 (file)
@@ -82,7 +82,7 @@ static __be16 gre_keymap_lookup(struct nf_conntrack_tuple *t)
        read_unlock_bh(&nf_ct_gre_lock);
 
        pr_debug("lookup src key 0x%x for ", key);
-       NF_CT_DUMP_TUPLE(t);
+       nf_ct_dump_tuple(t);
 
        return key;
 }
@@ -113,7 +113,7 @@ int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir,
        *kmp = km;
 
        pr_debug("adding new entry %p: ", km);
-       NF_CT_DUMP_TUPLE(&km->tuple);
+       nf_ct_dump_tuple(&km->tuple);
 
        write_lock_bh(&nf_ct_gre_lock);
        list_add_tail(&km->list, &gre_keymap_list);
@@ -238,7 +238,7 @@ static bool gre_new(struct nf_conn *ct, const struct sk_buff *skb,
                    unsigned int dataoff)
 {
        pr_debug(": ");
-       NF_CT_DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
+       nf_ct_dump_tuple(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
 
        /* initialize to sane value.  Ideally a conntrack helper
         * (e.g. in case of pptp) is increasing them */
index 73a8b32db7be4d4ff057410e98efcfecd82705ae..ba94004fe323182b6a527507548a1e54e1099321 100644 (file)
@@ -505,7 +505,7 @@ static bool tcp_in_window(const struct nf_conn *ct,
 
        pr_debug("tcp_in_window: START\n");
        pr_debug("tcp_in_window: ");
-       NF_CT_DUMP_TUPLE(tuple);
+       nf_ct_dump_tuple(tuple);
        pr_debug("seq=%u ack=%u sack=%u win=%u end=%u\n",
                 seq, ack, sack, win, end);
        pr_debug("tcp_in_window: sender end=%u maxend=%u maxwin=%u scale=%i "
@@ -592,7 +592,7 @@ static bool tcp_in_window(const struct nf_conn *ct,
                seq = end = sender->td_end;
 
        pr_debug("tcp_in_window: ");
-       NF_CT_DUMP_TUPLE(tuple);
+       nf_ct_dump_tuple(tuple);
        pr_debug("seq=%u ack=%u sack =%u win=%u end=%u\n",
                 seq, ack, sack, win, end);
        pr_debug("tcp_in_window: sender end=%u maxend=%u maxwin=%u scale=%i "
@@ -936,7 +936,7 @@ static int tcp_packet(struct nf_conn *ct,
        ct->proto.tcp.last_dir = dir;
 
        pr_debug("tcp_conntracks: ");
-       NF_CT_DUMP_TUPLE(tuple);
+       nf_ct_dump_tuple(tuple);
        pr_debug("syn=%i ack=%i fin=%i rst=%i old=%i new=%i\n",
                 (th->syn ? 1 : 0), (th->ack ? 1 : 0),
                 (th->fin ? 1 : 0), (th->rst ? 1 : 0),
index c3d5e84dcc9b8348c88eeb63f26d7547abd8768e..a94294b2b23ca71f2bfc30e3b88dc7dea962c373 100644 (file)
@@ -147,7 +147,7 @@ static int help(struct sk_buff *skb,
                          IPPROTO_TCP, NULL, &reply->port);
 
        pr_debug("nf_ct_sane: expect: ");
-       NF_CT_DUMP_TUPLE(&exp->tuple);
+       nf_ct_dump_tuple(&exp->tuple);
 
        /* Can't expect this?  Best to drop packet now. */
        if (nf_ct_expect_related(exp) != 0)
index ea5ff49d77bc667b1fe0c55ecab687121ff818e9..f57f6e7a71ee4e9e6913d7646dddfc8607ebe746 100644 (file)
@@ -55,8 +55,8 @@ static int tftp_help(struct sk_buff *skb,
        case TFTP_OPCODE_READ:
        case TFTP_OPCODE_WRITE:
                /* RRQ and WRQ works the same way */
-               NF_CT_DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
-               NF_CT_DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_REPLY].tuple);
+               nf_ct_dump_tuple(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
+               nf_ct_dump_tuple(&ct->tuplehash[IP_CT_DIR_REPLY].tuple);
 
                exp = nf_ct_expect_alloc(ct);
                if (exp == NULL)
@@ -68,7 +68,7 @@ static int tftp_help(struct sk_buff *skb,
                                  IPPROTO_UDP, NULL, &tuple->dst.u.udp.port);
 
                pr_debug("expect: ");
-               NF_CT_DUMP_TUPLE(&exp->tuple);
+               nf_ct_dump_tuple(&exp->tuple);
 
                nf_nat_tftp = rcu_dereference(nf_nat_tftp_hook);
                if (nf_nat_tftp && ct->status & IPS_NAT_MASK)