Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58980
b: refs/heads/master
c: e54cbc1
h: refs/heads/master
v: v3
  • Loading branch information
Yasuyuki Kozakai authored and David S. Miller committed Jul 11, 2007
1 parent aa424cc commit 4b75a2e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 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: ceceae1b1555a9afcb8dacf90df5fa1f20fd5466
refs/heads/master: e54cbc1f91dea4f98b6209e693d3b5eae46321bd
5 changes: 3 additions & 2 deletions trunk/include/net/netfilter/nf_nat.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ struct nf_nat_multi_range_compat
#include <linux/list.h>
#include <linux/netfilter/nf_conntrack_pptp.h>

struct nf_conn;

/* The structure embedded in the conntrack structure. */
struct nf_nat_info
{
struct list_head bysource;
struct nf_nat_seq seq[IP_CT_DIR_MAX];
struct nf_conn *ct;
};

/* per conntrack: nat application helper private data */
Expand All @@ -77,8 +80,6 @@ struct nf_conn_nat
#endif
};

struct nf_conn;

/* Set up the info structure to map into this range. */
extern unsigned int nf_nat_setup_info(struct nf_conn *ct,
const struct nf_nat_range *range,
Expand Down
4 changes: 3 additions & 1 deletion trunk/net/ipv4/netfilter/nf_nat_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ static void nf_nat_cleanup_conntrack(struct nf_conn *conn)
nat = nfct_nat(conn);
write_lock_bh(&nf_nat_lock);
list_del(&nat->info.bysource);
nat->info.ct = NULL;
write_unlock_bh(&nf_nat_lock);
}

Expand Down Expand Up @@ -169,7 +170,7 @@ find_appropriate_src(const struct nf_conntrack_tuple *tuple,

read_lock_bh(&nf_nat_lock);
list_for_each_entry(nat, &bysource[h], info.bysource) {
ct = (struct nf_conn *)((char *)nat - offsetof(struct nf_conn, data));
ct = nat->info.ct;
if (same_src(ct, tuple)) {
/* Copy source part from reply tuple. */
nf_ct_invert_tuplepr(result,
Expand Down Expand Up @@ -337,6 +338,7 @@ nf_nat_setup_info(struct nf_conn *ct,

srchash = hash_by_src(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
write_lock_bh(&nf_nat_lock);
info->ct = ct;
list_add(&info->bysource, &bysource[srchash]);
write_unlock_bh(&nf_nat_lock);
}
Expand Down

0 comments on commit 4b75a2e

Please sign in to comment.