summaryrefslogtreecommitdiff
path: root/ethtool.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2012-06-13 01:18:30 +0100
committerBen Hutchings <bhutchings@solarflare.com>2012-06-13 01:18:30 +0100
commit7a9bac28a46495c88c9008d8d4c5dda7d8b4a84f (patch)
treebae864b29694fb696c724d3ce540773a761786a3 /ethtool.c
parent74c42809c4cbd404c8f928a672df0e7ef43a90af (diff)
parentddb63dfb98296d01f5c06058d975d54939704f56 (diff)
downloadethtool-7a9bac28a46495c88c9008d8d4c5dda7d8b4a84f.tar.gz
Merge commit 'v3.4.1'
Diffstat (limited to 'ethtool.c')
-rw-r--r--ethtool.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/ethtool.c b/ethtool.c
index 3576f4c..b0d3eea 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -1337,6 +1337,10 @@ static struct feature_defs *get_feature_defs(struct cmd_context *ctx)
} else if (errno == EOPNOTSUPP || errno == EINVAL) {
/* Kernel doesn't support named features; not an error */
n_features = 0;
+ } else if (errno == EPERM) {
+ /* Kernel bug: ETHTOOL_GSSET_INFO was privileged.
+ * Work around it. */
+ n_features = 0;
} else {
return NULL;
}
@@ -1850,8 +1854,10 @@ static int do_gfeatures(struct cmd_context *ctx)
exit_bad_args();
defs = get_feature_defs(ctx);
- if (!defs)
+ if (!defs) {
+ perror("Cannot get device feature names");
return 1;
+ }
fprintf(stdout, "Features for %s:\n", ctx->devname);
@@ -1879,8 +1885,10 @@ static int do_sfeatures(struct cmd_context *ctx)
int i, j;
defs = get_feature_defs(ctx);
- if (!defs)
+ if (!defs) {
+ perror("Cannot get device feature names");
return 1;
+ }
if (defs->n_features) {
efeatures = malloc(sizeof(*efeatures) +
FEATURE_BITS_TO_BLOCKS(defs->n_features) *