Changeset 44726 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Feb 18, 2013 6:38:05 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/solaris/NetIf-solaris.cpp
r44528 r44726 74 74 } 75 75 76 static uint 64_t kstatGet(const char *name)76 static uint32_t kstatGet(const char *name) 77 77 { 78 78 kstat_ctl_t *kc; 79 uint 64_t uSpeed = 0;79 uint32_t uSpeed = 0; 80 80 81 81 if ((kc = kstat_open()) == 0) … … 104 104 LogRel(("kstat_data_lookup(ifspeed) -> %d, name=%s\n", errno, name)); 105 105 else 106 uSpeed = kn->value.ul ;106 uSpeed = kn->value.ul / 1000000; /* bits -> Mbits */ 107 107 } 108 108 kstat_close(kc); 109 LogFlow(("kstatGet(%s) -> %u Mbit/s\n", name, uSpeed)); 109 110 return uSpeed; 110 111 } … … 112 113 static void queryIfaceSpeed(PNETIFINFO pInfo) 113 114 { 114 pInfo->uSpeedMbits = kstatGet(pInfo->szShortName) / 1000000; /* bits -> Mbits */ 115 /* Don't query interface speed for inactive interfaces (see @bugref{6345}). */ 116 if (pInfo->enmStatus == NETIF_S_UP) 117 pInfo->uSpeedMbits = kstatGet(pInfo->szShortName); 118 else 119 pInfo->uSpeedMbits = 0; 120 LogFlow(("queryIfaceSpeed(%s) -> %u\n", pInfo->szShortName, pInfo->uSpeedMbits)); 115 121 } 116 122
Note:
See TracChangeset
for help on using the changeset viewer.