Changeset 15658 in vbox for trunk/src/VBox/Main
- Timestamp:
- Dec 18, 2008 1:58:53 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/linux/NetIfList-linux.cpp
r15548 r15658 39 39 #include "HostNetworkInterfaceImpl.h" 40 40 #include "netif.h" 41 #include "Logging.h" 41 42 42 43 int NetIfList(std::list <ComObjPtr <HostNetworkInterface> > &list) … … 86 87 unsigned uIndex, uLength, uScope, uTmp; 87 88 char szName[30]; 88 while (fscanf(fp, 89 "%08x%08x%08x%08x" 90 " %02x %02x %02x %02x %20s\n", 91 &IPv6Address.au32[0], &IPv6Address.au32[1], 92 &IPv6Address.au32[2], &IPv6Address.au32[3], 93 &uIndex, &uLength, &uScope, &uTmp, szName) != EOF) 89 for (;;) 94 90 { 91 memset(szName, 0, sizeof(szName)); 92 int n = fscanf(fp, 93 "%08x%08x%08x%08x" 94 " %02x %02x %02x %02x %20s\n", 95 &IPv6Address.au32[0], &IPv6Address.au32[1], 96 &IPv6Address.au32[2], &IPv6Address.au32[3], 97 &uIndex, &uLength, &uScope, &uTmp, szName); 98 if (n == EOF) 99 break; 100 if (n != 9 || uLength > 128) 101 { 102 Log(("NetIfList: Error while reading /proc/net/if_inet6, n=%d uLength=%u\n", 103 n, uLength)); 104 break; 105 } 95 106 if (!strcmp(pReq->ifr_name, szName)) 96 107 {
Note:
See TracChangeset
for help on using the changeset viewer.