ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/network_stats.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/network_stats.c (file contents):
Revision 1.79 by tdb, Mon Oct 9 17:23:07 2006 UTC vs.
Revision 1.80 by tdb, Mon Oct 9 17:25:06 2006 UTC

# Line 698 | Line 698 | sg_network_iface_stats *sg_get_network_iface_stats(int
698                          }
699  
700                          if ((ifr.ifr_flags & IFF_UP) != 0) {
701 <                                network_iface_stat_ptr->up = 1;
701 >                                if ((knp = kstat_data_lookup(ksp, "link_up")) != NULL) {
702 >                                        /* take in to account if link
703 >                                         * is up as well as interface */
704 >                                        if (knp->value.ui32 != 0u) {
705 >                                                network_iface_stat_ptr->up = 1;
706 >                                        } else {
707 >                                                network_iface_stat_ptr->up = 0;
708 >                                        }
709 >                                }
710 >                                else {
711 >                                        /* maintain compatibility */
712 >                                        network_iface_stat_ptr->up = 1;
713 >                                }
714                          } else {
715                                  network_iface_stat_ptr->up = 0;
716                          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines