Skip to content

Commit

Permalink
netfilter: nf_ct_helper: don't discard helper if it is actually the same
Browse files Browse the repository at this point in the history
commit (32f5376 netfilter: nf_ct_helper: disable automatic helper
re-assignment of different type) broke transparent proxy scenarios.

For example, initial helper lookup might yield "ftp" (dport 21),
while re-lookup after REDIRECT yields "ftp-2121".

This causes the autoassign code to toss the ftp helper, even
though these are just different instances of the same helper.

Change the test to check for the helper function address instead
of the helper address, as suggested by Pablo.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
  • Loading branch information
Florian Westphal authored and Pablo Neira Ayuso committed Feb 12, 2013
1 parent 442fad9 commit 6e2f0aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/netfilter/nf_conntrack_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl,
/* We only allow helper re-assignment of the same sort since
* we cannot reallocate the helper extension area.
*/
if (help->helper != helper) {
struct nf_conntrack_helper *tmp = rcu_dereference(help->helper);

if (tmp && tmp->help != helper->help) {
RCU_INIT_POINTER(help->helper, NULL);
goto out;
}
Expand Down

0 comments on commit 6e2f0aa

Please sign in to comment.