Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90705
b: refs/heads/master
c: 8c87238
h: refs/heads/master
i:
  90703: d210caa
v: v3
  • Loading branch information
Patrick McHardy committed Apr 14, 2008
1 parent 9cdb339 commit c6e8d4e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 42cf800c240fa845e9c154429d70d62750e65b64
refs/heads/master: 8c87238b726e543f8af4bdb4296020a328df4744
3 changes: 0 additions & 3 deletions trunk/include/net/netfilter/nf_nat_rule.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,4 @@ extern int nf_nat_rule_find(struct sk_buff *skb,

extern unsigned int
alloc_null_binding(struct nf_conn *ct, unsigned int hooknum);

extern unsigned int
alloc_null_binding_confirmed(struct nf_conn *ct, unsigned int hooknum);
#endif /* _NF_NAT_RULE_H */
19 changes: 0 additions & 19 deletions trunk/net/ipv4/netfilter/nf_nat_rule.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,25 +188,6 @@ alloc_null_binding(struct nf_conn *ct, unsigned int hooknum)
return nf_nat_setup_info(ct, &range, HOOK2MANIP(hooknum));
}

unsigned int
alloc_null_binding_confirmed(struct nf_conn *ct, unsigned int hooknum)
{
__be32 ip
= (HOOK2MANIP(hooknum) == IP_NAT_MANIP_SRC
? ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip
: ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3.ip);
__be16 all
= (HOOK2MANIP(hooknum) == IP_NAT_MANIP_SRC
? ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u.all
: ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u.all);
struct nf_nat_range range
= { IP_NAT_RANGE_MAP_IPS, ip, ip, { all }, { all } };

pr_debug("Allocating NULL binding for confirmed %p (%u.%u.%u.%u)\n",
ct, NIPQUAD(ip));
return nf_nat_setup_info(ct, &range, HOOK2MANIP(hooknum));
}

int nf_nat_rule_find(struct sk_buff *skb,
unsigned int hooknum,
const struct net_device *in,
Expand Down
8 changes: 4 additions & 4 deletions trunk/net/ipv4/netfilter/nf_nat_standalone.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ nf_nat_fn(unsigned int hooknum,

nat = nfct_nat(ct);
if (!nat) {
/* NAT module was loaded late. */
if (nf_ct_is_confirmed(ct))
return NF_ACCEPT;
nat = nf_ct_ext_add(ct, NF_CT_EXT_NAT, GFP_ATOMIC);
if (nat == NULL) {
pr_debug("failed to add NAT extension\n");
Expand All @@ -127,10 +130,7 @@ nf_nat_fn(unsigned int hooknum,
if (!nf_nat_initialized(ct, maniptype)) {
unsigned int ret;

if (unlikely(nf_ct_is_confirmed(ct)))
/* NAT module was loaded late */
ret = alloc_null_binding_confirmed(ct, hooknum);
else if (hooknum == NF_INET_LOCAL_IN)
if (hooknum == NF_INET_LOCAL_IN)
/* LOCAL_IN hook doesn't have a chain! */
ret = alloc_null_binding(ct, hooknum);
else
Expand Down

0 comments on commit c6e8d4e

Please sign in to comment.