Skip to content

Commit

Permalink
[NETFILTER]: ctnetlink: fix conntrack mark race
Browse files Browse the repository at this point in the history
Set conntrack mark before it is in hashes.

Signed-off-by: Pablo Neira Ayuso <[email protected]>
Signed-off-by: Patrick McHardy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
ummakynes authored and davem330 committed Jan 5, 2006
1 parent 0368309 commit d4d6bb4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions net/ipv4/netfilter/ip_conntrack_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,11 @@ ctnetlink_create_conntrack(struct nfattr *cda[],
return err;
}

#if defined(CONFIG_IP_NF_CONNTRACK_MARK)
if (cda[CTA_MARK-1])
ct->mark = ntohl(*(u_int32_t *)NFA_DATA(cda[CTA_MARK-1]));
#endif

ct->helper = ip_conntrack_helper_find_get(rtuple);

add_timer(&ct->timeout);
Expand All @@ -1039,11 +1044,6 @@ ctnetlink_create_conntrack(struct nfattr *cda[],
if (ct->helper)
ip_conntrack_helper_put(ct->helper);

#if defined(CONFIG_IP_NF_CONNTRACK_MARK)
if (cda[CTA_MARK-1])
ct->mark = ntohl(*(u_int32_t *)NFA_DATA(cda[CTA_MARK-1]));
#endif

DEBUGP("conntrack with id %u inserted\n", ct->id);
return 0;

Expand Down

0 comments on commit d4d6bb4

Please sign in to comment.