]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
netfilter: ctnetlink: remove dead NAT code
authorPatrick McHardy <kaber@trash.net>
Fri, 23 Dec 2011 13:01:36 +0000 (14:01 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 23 Dec 2011 13:36:46 +0000 (14:36 +0100)
The NAT range to nlattr conversation callbacks and helpers are entirely
dead code and are also useless since there are no NAT ranges in conntrack
context, they are only used for initially selecting a tuple. The final NAT
information is contained in the selected tuples of the conntrack entry.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_nat_protocol.h
net/ipv4/netfilter/nf_nat_proto_common.c
net/ipv4/netfilter/nf_nat_proto_dccp.c
net/ipv4/netfilter/nf_nat_proto_gre.c
net/ipv4/netfilter/nf_nat_proto_icmp.c
net/ipv4/netfilter/nf_nat_proto_sctp.c
net/ipv4/netfilter/nf_nat_proto_tcp.c
net/ipv4/netfilter/nf_nat_proto_udp.c
net/ipv4/netfilter/nf_nat_proto_udplite.c

index eaad0ac741cd9866ed811d0fda276e38bc2b1fb9..7b0b51165f701a3fbb42c0d38e12d81737c2d53e 100644 (file)
@@ -32,9 +32,6 @@ struct nf_nat_protocol {
                             enum nf_nat_manip_type maniptype,
                             const struct nf_conn *ct);
 
-       int (*range_to_nlattr)(struct sk_buff *skb,
-                              const struct nf_nat_ipv4_range *range);
-
        int (*nlattr_to_range)(struct nlattr *tb[],
                               struct nf_nat_ipv4_range *range);
 };
@@ -64,8 +61,6 @@ extern void nf_nat_proto_unique_tuple(struct nf_conntrack_tuple *tuple,
                                      const struct nf_conn *ct,
                                      u_int16_t *rover);
 
-extern int nf_nat_proto_range_to_nlattr(struct sk_buff *skb,
-                                       const struct nf_nat_ipv4_range *range);
 extern int nf_nat_proto_nlattr_to_range(struct nlattr *tb[],
                                        struct nf_nat_ipv4_range *range);
 
index 47fff91c9ae67b756f6388acd02c3201507c41ed..9993bc93e102d562b3f7c12c5dc79f388608454c 100644 (file)
@@ -96,18 +96,6 @@ void nf_nat_proto_unique_tuple(struct nf_conntrack_tuple *tuple,
 EXPORT_SYMBOL_GPL(nf_nat_proto_unique_tuple);
 
 #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
-int nf_nat_proto_range_to_nlattr(struct sk_buff *skb,
-                                const struct nf_nat_ipv4_range *range)
-{
-       NLA_PUT_BE16(skb, CTA_PROTONAT_PORT_MIN, range->min.all);
-       NLA_PUT_BE16(skb, CTA_PROTONAT_PORT_MAX, range->max.all);
-       return 0;
-
-nla_put_failure:
-       return -1;
-}
-EXPORT_SYMBOL_GPL(nf_nat_proto_nlattr_to_range);
-
 int nf_nat_proto_nlattr_to_range(struct nlattr *tb[],
                                 struct nf_nat_ipv4_range *range)
 {
@@ -122,5 +110,5 @@ int nf_nat_proto_nlattr_to_range(struct nlattr *tb[],
        }
        return 0;
 }
-EXPORT_SYMBOL_GPL(nf_nat_proto_range_to_nlattr);
+EXPORT_SYMBOL_GPL(nf_nat_proto_nlattr_to_range);
 #endif
index 466d63de2f777c5079ce1fbe10528724426d9fa1..3f67138d187cb25080900bf75351ed936fdbeeec 100644 (file)
@@ -84,7 +84,6 @@ static const struct nf_nat_protocol nf_nat_protocol_dccp = {
        .in_range               = nf_nat_proto_in_range,
        .unique_tuple           = dccp_unique_tuple,
 #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
-       .range_to_nlattr        = nf_nat_proto_range_to_nlattr,
        .nlattr_to_range        = nf_nat_proto_nlattr_to_range,
 #endif
 };
index 35cd158d4675dd9877a1fc70d8f97e2a3e66a916..46ba0b9ab985b70ac5c80883a642d3048ac3cf83 100644 (file)
@@ -123,7 +123,6 @@ static const struct nf_nat_protocol gre = {
        .in_range               = nf_nat_proto_in_range,
        .unique_tuple           = gre_unique_tuple,
 #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
-       .range_to_nlattr        = nf_nat_proto_range_to_nlattr,
        .nlattr_to_range        = nf_nat_proto_nlattr_to_range,
 #endif
 };
index 036c00952c11ffe1dfc13373e99225d29b39442c..b35172851bae8b92094bff8dc0da833968e43f39 100644 (file)
@@ -78,7 +78,6 @@ const struct nf_nat_protocol nf_nat_protocol_icmp = {
        .in_range               = icmp_in_range,
        .unique_tuple           = icmp_unique_tuple,
 #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
-       .range_to_nlattr        = nf_nat_proto_range_to_nlattr,
        .nlattr_to_range        = nf_nat_proto_nlattr_to_range,
 #endif
 };
index 50283abc594bc23ac7b0b4ec232f855ce8e707fb..3cce9b6c1c293c6c539cee0c3feef0c1930e2181 100644 (file)
@@ -74,7 +74,6 @@ static const struct nf_nat_protocol nf_nat_protocol_sctp = {
        .in_range               = nf_nat_proto_in_range,
        .unique_tuple           = sctp_unique_tuple,
 #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
-       .range_to_nlattr        = nf_nat_proto_range_to_nlattr,
        .nlattr_to_range        = nf_nat_proto_nlattr_to_range,
 #endif
 };
index e0e2ba8b52549e90ab4fd15023d2bfdb23abf295..9fb4b4e72bbfeea34f894eeacbac20da9e01a396 100644 (file)
@@ -86,7 +86,6 @@ const struct nf_nat_protocol nf_nat_protocol_tcp = {
        .in_range               = nf_nat_proto_in_range,
        .unique_tuple           = tcp_unique_tuple,
 #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
-       .range_to_nlattr        = nf_nat_proto_range_to_nlattr,
        .nlattr_to_range        = nf_nat_proto_nlattr_to_range,
 #endif
 };
index bde94cde6b15d87c4a96117bf0830004a390d87c..9883336e628fd2174ec7b272ed55481a2a8b847d 100644 (file)
@@ -77,7 +77,6 @@ const struct nf_nat_protocol nf_nat_protocol_udp = {
        .in_range               = nf_nat_proto_in_range,
        .unique_tuple           = udp_unique_tuple,
 #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
-       .range_to_nlattr        = nf_nat_proto_range_to_nlattr,
        .nlattr_to_range        = nf_nat_proto_nlattr_to_range,
 #endif
 };
index 58e9a3a1c8db03e0e7d20eff70706716fcfc267b..d24d10a7beb2ac50bb16bbe7968e8c7b567bbb34 100644 (file)
@@ -76,7 +76,6 @@ static const struct nf_nat_protocol nf_nat_protocol_udplite = {
        .in_range               = nf_nat_proto_in_range,
        .unique_tuple           = udplite_unique_tuple,
 #if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
-       .range_to_nlattr        = nf_nat_proto_range_to_nlattr,
        .nlattr_to_range        = nf_nat_proto_nlattr_to_range,
 #endif
 };