diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2005-01-16 21:57:48 -0800 |
---|---|---|
committer | David S. Miller <davem@nuts.davemloft.net> | 2005-01-16 21:57:48 -0800 |
commit | 1ae14212c6e6af2f7ca3522afe03d50084e9be7d (patch) | |
tree | 3adafffd7db6c1385b6ae7db677f64ddcbef1c2d | |
parent | 0cac72322fa2166ace69f581ab4fbf6e3638ef4f (diff) | |
download | history-1ae14212c6e6af2f7ca3522afe03d50084e9be7d.tar.gz |
[NETFILTER]: Remove remaining multirange related code
From: KOVACS Krisztian <hidden@sch.bme.hu>
Hi Rusty,
Your recent patch which removed the byipsproto hash left some unused
code around. The following patch cleans up that. I'm not sure it's
correct, but please take a look at it.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/netfilter_ipv4/ip_nat.h | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_nat_core.c | 21 |
2 files changed, 4 insertions, 21 deletions
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h index 06e5ad38683e4..c4366280256ae 100644 --- a/include/linux/netfilter_ipv4/ip_nat.h +++ b/include/linux/netfilter_ipv4/ip_nat.h @@ -16,8 +16,6 @@ enum ip_nat_manip_type #define IP_NAT_RANGE_MAP_IPS 1 #define IP_NAT_RANGE_PROTO_SPECIFIED 2 -/* Used internally by get_unique_tuple(). */ -#define IP_NAT_RANGE_FULL 4 /* NAT sequence number modifications */ struct ip_nat_seq { @@ -51,7 +49,7 @@ struct ip_nat_multi_range_compat }; /* Worst case: local-out manip + 1 post-routing, and reverse dirn. */ -#define IP_NAT_MAX_MANIPS (2*3) +#define IP_NAT_MAX_MANIPS (2*2) struct ip_nat_info_manip { diff --git a/net/ipv4/netfilter/ip_nat_core.c b/net/ipv4/netfilter/ip_nat_core.c index 93f7ea3621618..b6b3df4e6dcd6 100644 --- a/net/ipv4/netfilter/ip_nat_core.c +++ b/net/ipv4/netfilter/ip_nat_core.c @@ -51,15 +51,7 @@ static struct list_head *bysource; struct ip_nat_protocol *ip_nat_protos[MAX_IP_NAT_PROTO]; -/* We keep extra hashes for each conntrack, for fast searching. */ -static inline size_t -hash_by_ipsproto(u_int32_t src, u_int32_t dst, u_int16_t proto) -{ - /* Modified src and dst, to ensure we don't create two - identical streams. */ - return (src + dst + proto) % ip_nat_htable_size; -} - +/* We keep an extra hash for each conntrack, for fast searching. */ static inline size_t hash_by_src(const struct ip_conntrack_manip *manip, u_int16_t proto) { @@ -71,7 +63,7 @@ hash_by_src(const struct ip_conntrack_manip *manip, u_int16_t proto) static void ip_nat_cleanup_conntrack(struct ip_conntrack *conn) { struct ip_nat_info *info = &conn->nat.info; - unsigned int hs, hp; + unsigned int hs; if (!info->initialized) return; @@ -80,11 +72,6 @@ static void ip_nat_cleanup_conntrack(struct ip_conntrack *conn) conn->tuplehash[IP_CT_DIR_ORIGINAL] .tuple.dst.protonum); - hp = hash_by_ipsproto(conn->tuplehash[IP_CT_DIR_REPLY].tuple.src.ip, - conn->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip, - conn->tuplehash[IP_CT_DIR_REPLY] - .tuple.dst.protonum); - WRITE_LOCK(&ip_nat_lock); list_del(&info->bysource); WRITE_UNLOCK(&ip_nat_lock); @@ -336,15 +323,13 @@ ip_nat_setup_info(struct ip_conntrack *conntrack, DUMP_TUPLE(&orig_tp); DEBUGP("Range %p: ", mr); for (i = 0; i < mr->rangesize; i++) { - DEBUGP("%u:%s%s%s %u.%u.%u.%u - %u.%u.%u.%u %u - %u\n", + DEBUGP("%u:%s%s %u.%u.%u.%u - %u.%u.%u.%u %u - %u\n", i, (mr->range[i].flags & IP_NAT_RANGE_MAP_IPS) ? " MAP_IPS" : "", (mr->range[i].flags & IP_NAT_RANGE_PROTO_SPECIFIED) ? " PROTO_SPECIFIED" : "", - (mr->range[i].flags & IP_NAT_RANGE_FULL) - ? " FULL" : "", NIPQUAD(mr->range[i].min_ip), NIPQUAD(mr->range[i].max_ip), mr->range[i].min.all, |