From f3812395a261b80fe77d19ebb9045e790c434773 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 25 Jun 2015 16:41:39 +0100 Subject: [netdevice] Add a generic concept of a "blocked link" When Spanning Tree Protocol (STP) is used, there may be a substantial delay (tens of seconds) from the time that the link goes up to the time that the port starts forwarding packets. Add a generic concept of a "blocked link" (i.e. a link which is up but which is not expected to communicate successfully), and allow "ifstat" to indicate when a link is blocked. Signed-off-by: Michael Brown --- src/usr/ifmgmt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/usr') diff --git a/src/usr/ifmgmt.c b/src/usr/ifmgmt.c index 3228a487..aefdaa45 100644 --- a/src/usr/ifmgmt.c +++ b/src/usr/ifmgmt.c @@ -103,11 +103,12 @@ static void ifstat_errors ( struct net_device_stats *stats, */ void ifstat ( struct net_device *netdev ) { printf ( "%s: %s using %s on %s (%s)\n" - " [Link:%s, TX:%d TXE:%d RX:%d RXE:%d]\n", + " [Link:%s%s, TX:%d TXE:%d RX:%d RXE:%d]\n", netdev->name, netdev_addr ( netdev ), netdev->dev->driver_name, netdev->dev->name, ( netdev_is_open ( netdev ) ? "open" : "closed" ), ( netdev_link_ok ( netdev ) ? "up" : "down" ), + ( netdev_link_blocked ( netdev ) ? " (blocked)" : "" ), netdev->tx_stats.good, netdev->tx_stats.bad, netdev->rx_stats.good, netdev->rx_stats.bad ); if ( ! netdev_link_ok ( netdev ) ) { -- cgit v1.2.3-55-g7522