--- projects/libstatgrab/src/libstatgrab/network_stats.c 2006/10/09 17:23:07 1.79 +++ projects/libstatgrab/src/libstatgrab/network_stats.c 2006/10/09 17:25:06 1.80 @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA * - * $Id: network_stats.c,v 1.79 2006/10/09 17:23:07 tdb Exp $ + * $Id: network_stats.c,v 1.80 2006/10/09 17:25:06 tdb Exp $ */ #ifdef HAVE_CONFIG_H @@ -698,7 +698,19 @@ sg_network_iface_stats *sg_get_network_iface_stats(int } if ((ifr.ifr_flags & IFF_UP) != 0) { - network_iface_stat_ptr->up = 1; + if ((knp = kstat_data_lookup(ksp, "link_up")) != NULL) { + /* take in to account if link + * is up as well as interface */ + if (knp->value.ui32 != 0u) { + network_iface_stat_ptr->up = 1; + } else { + network_iface_stat_ptr->up = 0; + } + } + else { + /* maintain compatibility */ + network_iface_stat_ptr->up = 1; + } } else { network_iface_stat_ptr->up = 0; }