diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2011-05-13 01:52:27 +0100 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2011-05-13 02:13:26 +0100 |
commit | a0e0cc44dbbebaa2e7cebcecbe506500d1f9e4a7 (patch) | |
tree | 339506ae4d9f775729b9cf6cf24a2bfcabb9a242 | |
parent | 8d63f72ccdcb1b19358d753a8f48f08dcd2136f0 (diff) | |
download | ethtool-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.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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) |