From a0e0cc44dbbebaa2e7cebcecbe506500d1f9e4a7 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 13 May 2011 01:52:27 +0100 Subject: 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 --- ethtool.c | 9 ++++++--- 1 file 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) -- cgit v1.2.1