Skip to contentSkip to conversation

netfilter: cttimeout: Return -EOPNOTSUPP if l4proto doesn't support

PATCH New [email protected] 1 participant 1 message Apr 6, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: cttimeout: Return -EOPNOTSUPP if l4proto doesn't support

From: Gao Feng <[email protected]>

Return -EOPNOTSUPP instead of success when l4proto doesn't support set the timeout attribute.

It is better to return error when fail to set timeout.

---
 net/netfilter/nfnetlink_cttimeout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nfnetlink_cttimeout.c +1 -1
index baa75f3..0b12e8c6 100644
@@ -50,7 +50,7 @@
 ctnl_timeout_parse_policy(void *timeouts, struct nf_conntrack_l4proto *l4proto,
 			  struct net *net, const struct nlattr *attr)
 {
-	int ret = 0;
+	int ret = -EOPNOTSUPP;
 
 	if (likely(l4proto->ctnl_timeout.nlattr_to_obj)) {
 		struct nlattr *tb[l4proto->ctnl_timeout.nlattr_max+1];
Signature · 1 line
1.9.1