summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-05-13 01:52:27 +0100
committerBen Hutchings <bhutchings@solarflare.com>2011-05-13 02:13:26 +0100
commita0e0cc44dbbebaa2e7cebcecbe506500d1f9e4a7 (patch)
tree339506ae4d9f775729b9cf6cf24a2bfcabb9a242
parent8d63f72ccdcb1b19358d753a8f48f08dcd2136f0 (diff)
downloadethtool-a0e0cc44dbbebaa2e7cebcecbe506500d1f9e4a7.tar.gz
ethtool: Treat positive return from ETHTOOL_SRXNTUPLE as successful
The sfc driver can currently return a positive value (the filter index) on success. This is a bug in the driver, but ethtool previously accepted it. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r--ethtool.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ethtool.c b/ethtool.c
index 2e04d87..34fe107 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -3170,10 +3170,13 @@ static int do_srxntuple(int fd, struct ifreq *ifr)
* supported. It is possible that the interface uses the network
* flow classifier interface instead of N-tuple.
*/
- if (err && errno != EOPNOTSUPP)
- perror("Cannot add new rule via N-tuple");
+ if (err < 0) {
+ if (errno != EOPNOTSUPP)
+ perror("Cannot add new rule via N-tuple");
+ return -1;
+ }
- return err;
+ return 0;
}
static int do_srxclsrule(int fd, struct ifreq *ifr)