aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPablo Neira <pablo@eurodev.net>2005-08-09 23:02:55 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 18:39:05 -0400
commit88aa0429048d08c18f2772782588f953bbbd79be (patch)
treeb8f6cebd9e682882394b92e7e737436b3648e1d7 /net
parent94cd2b67641e7ddc2e6ed71d76e00116957423db (diff)
[NETFILTER]: conntrack_netlink: Fix locking during conntrack_create
The current codepath allowed for ip_conntrack_lock to be unlock'ed twice. Signed-off-by: Pablo Neira <pablo@eurodev.net> Signed-off-by: Harald Welte <laforge@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/netfilter/ip_conntrack_netlink.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/net/ipv4/netfilter/ip_conntrack_netlink.c b/net/ipv4/netfilter/ip_conntrack_netlink.c
index 36a046f22105..0ab2d7df6bc4 100644
--- a/net/ipv4/netfilter/ip_conntrack_netlink.c
+++ b/net/ipv4/netfilter/ip_conntrack_netlink.c
@@ -1052,13 +1052,14 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
1052 err = -ENOENT; 1052 err = -ENOENT;
1053 if (nlh->nlmsg_flags & NLM_F_CREATE) 1053 if (nlh->nlmsg_flags & NLM_F_CREATE)
1054 err = ctnetlink_create_conntrack(cda, &otuple, &rtuple); 1054 err = ctnetlink_create_conntrack(cda, &otuple, &rtuple);
1055 return err;
1056 }
1057 /* implicit 'else' */
1058
1059 /* we only allow nat config for new conntracks */
1060 if (cda[CTA_NAT-1]) {
1061 err = -EINVAL;
1055 goto out_unlock; 1062 goto out_unlock;
1056 } else {
1057 /* we only allow nat config for new conntracks */
1058 if (cda[CTA_NAT-1]) {
1059 err = -EINVAL;
1060 goto out_unlock;
1061 }
1062 } 1063 }
1063 1064
1064 /* We manipulate the conntrack inside the global conntrack table lock, 1065 /* We manipulate the conntrack inside the global conntrack table lock,