aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxim Mikityanskiy <maximmi@mellanox.com>2020-08-14 16:17:44 +0300
committerMichal Kubecek <mkubecek@suse.cz>2020-08-23 13:04:17 +0200
commit83d2b635de121a16a27663cc4e3045243e56063b (patch)
tree24c4533b176939e575162692eb69de5ef822fda3
parent88ca347ef35acb16ec0a0107f55ab599ddb18f56 (diff)
downloadethtool-83d2b635de121a16a27663cc4e3045243e56063b.tar.gz
netlink: Fix the condition for displaying actual changes
This comment in the code: /* result is not exactly as requested, show differences */ implies that the "Actual changes" output should be displayed only if the result is not as requested, which matches the legacy ethtool behavior. However, in fact, ethtool-netlink displays "actual changes" even when the changes are expected (e.g., one bit was requested, and it was changed as requested). This commit fixes the condition above to make the behavior match the description in the comment and the behavior of the legacy ethtool. The new condition excludes the req_mask bits from active_mask to avoid reacting on bit changes that we asked for. The new condition now matches the ifs in the loop above that print "[requested on/off]" and "[not requested]". Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com> Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
-rw-r--r--netlink/features.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/netlink/features.c b/netlink/features.c
index 8b5b858..133529d 100644
--- a/netlink/features.c
+++ b/netlink/features.c
@@ -413,7 +413,7 @@ static void show_feature_changes(struct nl_context *nlctx,
diff = false;
for (i = 0; i < words; i++)
- if (wanted_mask[i] || active_mask[i])
+ if (wanted_mask[i] || (active_mask[i] & ~sfctx->req_mask[i]))
diff = true;
if (!diff)
return;