aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2006-01-05 15:18:25 -0500
committerDavid S. Miller <davem@davemloft.net>2006-01-05 15:18:25 -0500
commitd4d6bb41e09f07668ca2655da707eab936e8e8f0 (patch)
treea785fa9ade81b7591ff33c54a23fbcf234f296f5 /net
parent0368309cb45bbba99f84a01d5fc6a18780788480 (diff)
[NETFILTER]: ctnetlink: fix conntrack mark race
Set conntrack mark before it is in hashes. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/netfilter/ip_conntrack_netlink.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv4/netfilter/ip_conntrack_netlink.c b/net/ipv4/netfilter/ip_conntrack_netlink.c
index 04137d0c164c..df04ad873cc2 100644
--- a/net/ipv4/netfilter/ip_conntrack_netlink.c
+++ b/net/ipv4/netfilter/ip_conntrack_netlink.c
@@ -1031,6 +1031,11 @@ ctnetlink_create_conntrack(struct nfattr *cda[],
1031 return err; 1031 return err;
1032 } 1032 }
1033 1033
1034#if defined(CONFIG_IP_NF_CONNTRACK_MARK)
1035 if (cda[CTA_MARK-1])
1036 ct->mark = ntohl(*(u_int32_t *)NFA_DATA(cda[CTA_MARK-1]));
1037#endif
1038
1034 ct->helper = ip_conntrack_helper_find_get(rtuple); 1039 ct->helper = ip_conntrack_helper_find_get(rtuple);
1035 1040
1036 add_timer(&ct->timeout); 1041 add_timer(&ct->timeout);
@@ -1039,11 +1044,6 @@ ctnetlink_create_conntrack(struct nfattr *cda[],
1039 if (ct->helper) 1044 if (ct->helper)
1040 ip_conntrack_helper_put(ct->helper); 1045 ip_conntrack_helper_put(ct->helper);
1041 1046
1042#if defined(CONFIG_IP_NF_CONNTRACK_MARK)
1043 if (cda[CTA_MARK-1])
1044 ct->mark = ntohl(*(u_int32_t *)NFA_DATA(cda[CTA_MARK-1]));
1045#endif
1046
1047 DEBUGP("conntrack with id %u inserted\n", ct->id); 1047 DEBUGP("conntrack with id %u inserted\n", ct->id);
1048 return 0; 1048 return 0;
1049 1049