Skip to content

Commit

Permalink
[NETFILTER]: nfctnetlink: assign helper to newly created conntrack
Browse files Browse the repository at this point in the history
This fixes the bug which doesn't assign helper to newly created
conntrack via nf_conntrack_netlink.

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 Nov 29, 2006
1 parent 691ce26 commit dafc741
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/netfilter/nf_conntrack_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,7 @@ ctnetlink_create_conntrack(struct nfattr *cda[],
{
struct nf_conn *ct;
int err = -EINVAL;
struct nf_conn_help *help;

ct = nf_conntrack_alloc(otuple, rtuple);
if (ct == NULL || IS_ERR(ct))
Expand Down Expand Up @@ -976,9 +977,16 @@ ctnetlink_create_conntrack(struct nfattr *cda[],
ct->mark = ntohl(*(u_int32_t *)NFA_DATA(cda[CTA_MARK-1]));
#endif

help = nfct_help(ct);
if (help)
help->helper = nf_ct_helper_find_get(rtuple);

add_timer(&ct->timeout);
nf_conntrack_hash_insert(ct);

if (help && help->helper)
nf_ct_helper_put(help->helper);

return 0;

err:
Expand Down

0 comments on commit dafc741

Please sign in to comment.