]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
bonding: fix slave speed reporting in bond_miimon_commit
authorNikolay Aleksandrov <nikolay@redhat.com>
Thu, 20 Jun 2013 12:34:13 +0000 (14:34 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Jun 2013 07:04:55 +0000 (00:04 -0700)
When we have BOND_LINK_UP the speed is reported unconditionally with %u
format although it can be SPEED_UNKNOWN (-1). After this patch it returns
0 in that case in an attempt to keep the existing scripts happy.
One line is intenionally left 81 chars because it gets ugly if broken.

Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Acked-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c

index 02d9ae7d527e14894d71e67e93372773ad9e5ea0..f975696135265a68a5946d7f784d4688f4ad0d30 100644 (file)
@@ -2413,7 +2413,8 @@ static void bond_miimon_commit(struct bonding *bond)
 
                        pr_info("%s: link status definitely up for interface %s, %u Mbps %s duplex.\n",
                                bond->dev->name, slave->dev->name,
-                               slave->speed, slave->duplex ? "full" : "half");
+                               slave->speed == SPEED_UNKNOWN ? 0 : slave->speed,
+                               slave->duplex ? "full" : "half");
 
                        /* notify ad that the link status has changed */
                        if (bond->params.mode == BOND_MODE_8023AD)