Commit dafc741cf23351a6f43895579a72ab8818ba00ae
Committed by
David S. Miller
1 parent
691ce26e40
Exists in
master
and in
7 other branches
[NETFILTER]: nfctnetlink: assign helper to newly created conntrack
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>
Showing 1 changed file with 8 additions and 0 deletions Side-by-side Diff
net/netfilter/nf_conntrack_netlink.c
... | ... | @@ -949,6 +949,7 @@ |
949 | 949 | { |
950 | 950 | struct nf_conn *ct; |
951 | 951 | int err = -EINVAL; |
952 | + struct nf_conn_help *help; | |
952 | 953 | |
953 | 954 | ct = nf_conntrack_alloc(otuple, rtuple); |
954 | 955 | if (ct == NULL || IS_ERR(ct)) |
955 | 956 | |
... | ... | @@ -976,8 +977,15 @@ |
976 | 977 | ct->mark = ntohl(*(u_int32_t *)NFA_DATA(cda[CTA_MARK-1])); |
977 | 978 | #endif |
978 | 979 | |
980 | + help = nfct_help(ct); | |
981 | + if (help) | |
982 | + help->helper = nf_ct_helper_find_get(rtuple); | |
983 | + | |
979 | 984 | add_timer(&ct->timeout); |
980 | 985 | nf_conntrack_hash_insert(ct); |
986 | + | |
987 | + if (help && help->helper) | |
988 | + nf_ct_helper_put(help->helper); | |
981 | 989 | |
982 | 990 | return 0; |
983 | 991 |