[ethtool] 02/20: ethtool: Fix the "advertise" parameter logic.

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Wed Aug 30 12:59:24 UTC 2017


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch master
in repository ethtool.

commit 135232204051808cf9317fe3589459994ba2413b
Author: Michael Chan <mchan at broadcom.com>
Date:   Tue Nov 22 18:55:47 2016 -0500

    ethtool: Fix the "advertise" parameter logic.
    
    The current code ignores the value of the advertise parameter.  For example,
    
    ethtool -s ethx advertise 0x1000
    
    The full_advertising_wanted parameter of 0x1000 is not passed to the kernel.
    The reason is that advertising_wanted is NULL in this case, and ethtool
    will think that the user has given no advertisement input and so it will
    proceed to pass all supported advertisement speeds to the kernel.
    
    The older legacy ethtool with similar logic worked because
    advertising_wanted was an integer and could take on -1 and 0.  It would pass
    the full_advertising_wanted value if advertising_wanted == -1.
    
    This fix is to pass all supported advertisement speeds only when both
    advertising_wanted == NULL && full_advertising_wanted == NULL.
    
    Signed-off-by: Michael Chan <michael.chan at broadcom.com>
    Signed-off-by: John W. Linville <linville at tuxdriver.com>
---
 ethtool.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ethtool.c b/ethtool.c
index 75299c6..62f86ef 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -2972,7 +2972,8 @@ static int do_sset(struct cmd_context *ctx)
 				fprintf(stderr,	"\n");
 			}
 			if (autoneg_wanted == AUTONEG_ENABLE &&
-			    advertising_wanted == NULL) {
+			    advertising_wanted == NULL &&
+			    full_advertising_wanted == NULL) {
 				unsigned int i;
 
 				/* Auto negotiation enabled, but with

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/ethtool.git



More information about the Kernel-svn-changes mailing list