Patchwork netfilter 13/29: ctnetlink: use EOPNOTSUPP instead of EINVAL if the conntrack has no helper

login
register
mail settings
Submitter Patrick McHardy
Date Nov. 27, 2008, 4:15 p.m.
Message ID <20081127161520.13891.58312.sendpatchset@x2.localnet>
Download mbox | patch
Permalink /patch/11240/
State Accepted
Delegated to: David Miller
Headers show

Comments

Patrick McHardy - Nov. 27, 2008, 4:15 p.m.
commit bfe2967735e0e0f650bf698a5683db2b6cf4cfd7
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date:   Mon Nov 17 15:55:48 2008 +0100

    netfilter: ctnetlink: use EOPNOTSUPP instead of EINVAL if the conntrack	has no helper
    
    This patch changes the return value if the conntrack has no helper assigned.
    Instead of EINVAL, which is reserved for malformed messages, it returns
    EOPNOTSUPP.
    
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Patrick McHardy <kaber@trash.net>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index 80a3f13..d87a939 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -1652,7 +1652,7 @@  ctnetlink_create_expect(struct nlattr *cda[], u_int8_t u3)
 
 	if (!help || !help->helper) {
 		/* such conntrack hasn't got any helper, abort */
-		err = -EINVAL;
+		err = -EOPNOTSUPP;
 		goto out;
 	}