Skip to content

Commit

Permalink
ethtool: don't propagate EOPNOTSUPP from dumps
Browse files Browse the repository at this point in the history
The default dump handler needs to clear ret before returning.
Otherwise if the last interface returns an inconsequential
error this error will propagate to user space.

This may confuse user space (ethtool CLI seems to ignore it,
but YNL doesn't). It will also terminate the dump early
for mutli-skb dump, because netlink core treats EOPNOTSUPP
as a real error.

Fixes: 728480f ("ethtool: default handlers for GET requests")
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20231126225806.2143528-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Nov 29, 2023
1 parent 9870257 commit cbeb989
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/ethtool/netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ static int ethnl_default_dumpit(struct sk_buff *skb,
ret = skb->len;
break;
}
ret = 0;
}
rtnl_unlock();

Expand Down

0 comments on commit cbeb989

Please sign in to comment.