Skip to content

Commit

Permalink
[NETFILTER]: nf_nat: Clears helper private area when NATing
Browse files Browse the repository at this point in the history
Some helpers (eg. ftp) assume that private area in conntrack is
filled with zero. It should be cleared when helper is changed.

Signed-off-by: Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yasuyuki Kozakai authored and David S. Miller committed May 11, 2007
1 parent df293bb commit 5d78a84
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions net/netfilter/nf_conntrack_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,8 +888,13 @@ void nf_conntrack_alter_reply(struct nf_conn *ct,
NF_CT_DUMP_TUPLE(newreply);

ct->tuplehash[IP_CT_DIR_REPLY].tuple = *newreply;
if (!ct->master && help && help->expecting == 0)
help->helper = __nf_ct_helper_find(newreply);
if (!ct->master && help && help->expecting == 0) {
struct nf_conntrack_helper *helper;
helper = __nf_ct_helper_find(newreply);
if (helper)
memset(&help->help, 0, sizeof(help->help));
help->helper = helper;
}
write_unlock_bh(&nf_conntrack_lock);
}
EXPORT_SYMBOL_GPL(nf_conntrack_alter_reply);
Expand Down

0 comments on commit 5d78a84

Please sign in to comment.