]> Pileus Git - ~andy/linux/commitdiff
netfilter: nf_nat: support IPv6 in IRC NAT helper
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 26 Aug 2012 17:14:27 +0000 (19:14 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 30 Aug 2012 01:00:23 +0000 (03:00 +0200)
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
net/ipv4/netfilter/Kconfig
net/ipv4/netfilter/Makefile
net/netfilter/Kconfig
net/netfilter/Makefile
net/netfilter/nf_conntrack_irc.c
net/netfilter/nf_nat_irc.c [moved from net/ipv4/netfilter/nf_nat_irc.c with 92% similarity]

index 30197f8003be1238766dca56c6a148d64e70714e..843fe17db20d8006753ddc71712f41ff985b961d 100644 (file)
@@ -221,11 +221,6 @@ config NF_NAT_PROTO_GRE
        tristate
        depends on NF_NAT_IPV4 && NF_CT_PROTO_GRE
 
-config NF_NAT_IRC
-       tristate
-       depends on NF_CONNTRACK && NF_NAT_IPV4
-       default NF_NAT_IPV4 && NF_CONNTRACK_IRC
-
 config NF_NAT_TFTP
        tristate
        depends on NF_CONNTRACK && NF_NAT_IPV4
index 8914abffc96ddad6fb9e3bcbba73b0cc2f960396..17e649bb98baf0ff433e7fc79f551556089045ec 100644 (file)
@@ -21,7 +21,6 @@ obj-$(CONFIG_NF_DEFRAG_IPV4) += nf_defrag_ipv4.o
 
 # NAT helpers (nf_conntrack)
 obj-$(CONFIG_NF_NAT_H323) += nf_nat_h323.o
-obj-$(CONFIG_NF_NAT_IRC) += nf_nat_irc.o
 obj-$(CONFIG_NF_NAT_PPTP) += nf_nat_pptp.o
 obj-$(CONFIG_NF_NAT_SNMP_BASIC) += nf_nat_snmp_basic.o
 obj-$(CONFIG_NF_NAT_TFTP) += nf_nat_tftp.o
index bf3e4649efb23e5ea5da8fa66cab8460bb5b67ec..cabe4da0e191a6993a57711ed091a10d0918ac14 100644 (file)
@@ -390,6 +390,11 @@ config NF_NAT_FTP
        depends on NF_CONNTRACK && NF_NAT
        default NF_NAT && NF_CONNTRACK_FTP
 
+config NF_NAT_IRC
+       tristate
+       depends on NF_CONNTRACK && NF_NAT
+       default NF_NAT && NF_CONNTRACK_IRC
+
 config NF_NAT_SIP
        tristate
        depends on NF_CONNTRACK && NF_NAT
index 7d6d1a035f3149ed70e4c0edcdbcdef4ffcf73e5..0dd792972cae53d29a914dad82485e1ba650a060 100644 (file)
@@ -57,6 +57,7 @@ obj-$(CONFIG_NF_NAT_PROTO_SCTP) += nf_nat_proto_sctp.o
 # NAT helpers
 obj-$(CONFIG_NF_NAT_AMANDA) += nf_nat_amanda.o
 obj-$(CONFIG_NF_NAT_FTP) += nf_nat_ftp.o
+obj-$(CONFIG_NF_NAT_IRC) += nf_nat_irc.o
 obj-$(CONFIG_NF_NAT_SIP) += nf_nat_sip.o
 
 # transparent proxy support
index 95d097cdb202bc3f6b94d6023e3ade8706d583a5..3b20aa77cfc8b76ef1ed78b0b85aacd926f3ce29 100644 (file)
@@ -205,8 +205,7 @@ static int help(struct sk_buff *skb, unsigned int protoff,
                                          IPPROTO_TCP, NULL, &port);
 
                        nf_nat_irc = rcu_dereference(nf_nat_irc_hook);
-                       if (nf_nat_irc && nf_ct_l3num(ct) == NFPROTO_IPV4 &&
-                           ct->status & IPS_NAT_MASK)
+                       if (nf_nat_irc && ct->status & IPS_NAT_MASK)
                                ret = nf_nat_irc(skb, ctinfo, protoff,
                                                 addr_beg_p - ib_ptr,
                                                 addr_end_p - addr_beg_p,
similarity index 92%
rename from net/ipv4/netfilter/nf_nat_irc.c
rename to net/netfilter/nf_nat_irc.c
index 1ce37f89ec789cafe8c0792453e891e14522011b..1fedee6e7fb6974300aeac0d86c2c360a29b6394 100644 (file)
@@ -34,7 +34,6 @@ static unsigned int help(struct sk_buff *skb,
                         struct nf_conntrack_expect *exp)
 {
        char buffer[sizeof("4294967296 65635")];
-       u_int32_t ip;
        u_int16_t port;
        unsigned int ret;
 
@@ -60,11 +59,6 @@ static unsigned int help(struct sk_buff *skb,
        if (port == 0)
                return NF_DROP;
 
-       ip = ntohl(exp->master->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip);
-       sprintf(buffer, "%u %u", ip, port);
-       pr_debug("nf_nat_irc: inserting '%s' == %pI4, port %u\n",
-                buffer, &ip, port);
-
        ret = nf_nat_mangle_tcp_packet(skb, exp->master, ctinfo,
                                       protoff, matchoff, matchlen, buffer,
                                       strlen(buffer));