Only some drivers (and none before kernel version 2.6.31) currently
set these flags.  When the flags are equal to 0 and so we don't know
what the link partner advertised, don't report anything.

Signed-off-by: Ben Hutchings <b...@decadent.org.uk>
---
 ethtool.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/ethtool.c b/ethtool.c
index 10dfc80..298b690 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -948,7 +948,9 @@ static int dump_ecmd(struct ethtool_cmd *ep)
 
        dump_supported(ep);
        dump_advertised(ep, "Advertised", ep->advertising);
-       dump_advertised(ep, "Link partner advertised", ep->lp_advertising);
+       if (ep->lp_advertising)
+               dump_advertised(ep, "Link partner advertised",
+                               ep->lp_advertising);
 
        fprintf(stdout, "       Speed: ");
        speed = ethtool_cmd_speed(ep);
-- 
1.6.5.7





--
To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to