Skip to contentSkip to conversation

: Improve error codes for unsupported operations

RTNL Applied Thomas Graf 2 participants 2 messages Apr 5, 2007

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

The most common trigger of these errors is that the config option hasn't been enable wich would make the functionality available. Therefore returning EOPNOTSUPP gives a better idea on what is going wrong.

net/core/rtnetlink.c +3 -3
Index: net-2.6.22/net/core/rtnetlink.c
===================================================================
@@ -861,7 +861,7 @@ static int rtnetlink_rcv_msg(struct sk_b
 
 	type = nlh->nlmsg_type;
 	if (type > RTM_MAX)
-		return -EINVAL;
+		return -EOPNOTSUPP;
 
 	type -= RTM_BASE;
 
@@ -884,7 +884,7 @@ static int rtnetlink_rcv_msg(struct sk_b
 
 		dumpit = rtnl_get_dumpit(family, type);
 		if (dumpit == NULL)
-			return -EINVAL;
+			return -EOPNOTSUPP;
 
 		return netlink_dump_start(rtnl, skb, nlh, dumpit, NULL);
 	}
@@ -912,7 +912,7 @@ static int rtnetlink_rcv_msg(struct sk_b
 
 	doit = rtnl_get_doit(family, type);
 	if (doit == NULL)
-		return -EINVAL;
+		return -EOPNOTSUPP;
 
 	return doit(skb, nlh, (void *)&rta_buf[0]);
 }
maintainer Applied
#1 lore raw

From: Thomas Graf <[email protected]>
Date: Thu, 5 Apr 2007 16:34:02 +0200

Quoted 6 lines

The most common trigger of these errors is that the config option hasn't been enable wich would make the functionality available. Therefore returning EOPNOTSUPP gives a better idea on what is going wrong.

Applied, thanks a lot Thomas.