Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102699
b: refs/heads/master
c: 0adf9d6
h: refs/heads/master
i:
  102697: d50b5b5
  102695: 8294569
v: v3
  • Loading branch information
Pablo Neira Ayuso authored and David S. Miller committed Jun 9, 2008
1 parent ef29749 commit 49622af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 93f65158723ceb7078ee9a0fd4830c0de00f4b9e
refs/heads/master: 0adf9d67489cd30bab8eb93f7de81a674e44e1c3
21 changes: 10 additions & 11 deletions trunk/net/netfilter/nf_conntrack_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* (C) 2001 by Jay Schulist <jschlst@samba.org>
* (C) 2002-2006 by Harald Welte <laforge@gnumonks.org>
* (C) 2003 by Patrick Mchardy <kaber@trash.net>
* (C) 2005-2007 by Pablo Neira Ayuso <pablo@netfilter.org>
* (C) 2005-2008 by Pablo Neira Ayuso <pablo@netfilter.org>
*
* Initial connection tracking via netlink development funded and
* generally made possible by Network Robots, Inc. (www.networkrobots.com)
Expand Down Expand Up @@ -891,20 +891,19 @@ ctnetlink_change_status(struct nf_conn *ct, struct nlattr *cda[])

if (d & (IPS_EXPECTED|IPS_CONFIRMED|IPS_DYING))
/* unchangeable */
return -EINVAL;
return -EBUSY;

if (d & IPS_SEEN_REPLY && !(status & IPS_SEEN_REPLY))
/* SEEN_REPLY bit can only be set */
return -EINVAL;

return -EBUSY;

if (d & IPS_ASSURED && !(status & IPS_ASSURED))
/* ASSURED bit can only be set */
return -EINVAL;
return -EBUSY;

if (cda[CTA_NAT_SRC] || cda[CTA_NAT_DST]) {
#ifndef CONFIG_NF_NAT_NEEDED
return -EINVAL;
return -EOPNOTSUPP;
#else
struct nf_nat_range range;

Expand Down Expand Up @@ -945,7 +944,7 @@ ctnetlink_change_helper(struct nf_conn *ct, struct nlattr *cda[])

/* don't change helper of sibling connections */
if (ct->master)
return -EINVAL;
return -EBUSY;

err = ctnetlink_parse_help(cda[CTA_HELP], &helpname);
if (err < 0)
Expand All @@ -963,7 +962,7 @@ ctnetlink_change_helper(struct nf_conn *ct, struct nlattr *cda[])

helper = __nf_conntrack_helper_find_byname(helpname);
if (helper == NULL)
return -EINVAL;
return -EOPNOTSUPP;

if (help) {
if (help->helper == helper)
Expand Down Expand Up @@ -1258,12 +1257,12 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
if (!(nlh->nlmsg_flags & NLM_F_EXCL)) {
/* we only allow nat config for new conntracks */
if (cda[CTA_NAT_SRC] || cda[CTA_NAT_DST]) {
err = -EINVAL;
err = -EOPNOTSUPP;
goto out_unlock;
}
/* can't link an existing conntrack to a master */
if (cda[CTA_TUPLE_MASTER]) {
err = -EINVAL;
err = -EOPNOTSUPP;
goto out_unlock;
}
err = ctnetlink_change_conntrack(nf_ct_tuplehash_to_ctrack(h),
Expand Down Expand Up @@ -1608,7 +1607,7 @@ ctnetlink_del_expect(struct sock *ctnl, struct sk_buff *skb,
h = __nf_conntrack_helper_find_byname(name);
if (!h) {
spin_unlock_bh(&nf_conntrack_lock);
return -EINVAL;
return -EOPNOTSUPP;
}
for (i = 0; i < nf_ct_expect_hsize; i++) {
hlist_for_each_entry_safe(exp, n, next,
Expand Down

0 comments on commit 49622af

Please sign in to comment.