Changeset 23203 in vbox for trunk/src/VBox/Main
- Timestamp:
- Sep 22, 2009 6:13:09 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/linux/NetIf-linux.cpp
r22180 r23203 53 53 int iFlags; 54 54 55 while (fgets(szBuf, sizeof(szBuf)-1, fp)) 56 { 57 int n = sscanf(szBuf, "%16s %128s %128s %X %d %d %d %128s %d %d %d\n", 58 szIfName, szAddr, szGateway, &iFlags, &iTmp, &iTmp, &iTmp, 59 szMask, &iTmp, &iTmp, &iTmp); 60 if (n < 10 || !(iFlags & RTF_UP)) 61 continue; 62 63 if (strcmp(szAddr, "00000000") == 0 && strcmp(szMask, "00000000") == 0) 64 { 65 fclose(fp); 66 strncpy(pszName, szIfName, 16); 67 pszName[16] = 0; 68 return VINF_SUCCESS; 55 if (fp) 56 { 57 while (fgets(szBuf, sizeof(szBuf)-1, fp)) 58 { 59 int n = sscanf(szBuf, "%16s %128s %128s %X %d %d %d %128s %d %d %d\n", 60 szIfName, szAddr, szGateway, &iFlags, &iTmp, &iTmp, &iTmp, 61 szMask, &iTmp, &iTmp, &iTmp); 62 if (n < 10 || !(iFlags & RTF_UP)) 63 continue; 64 65 if (strcmp(szAddr, "00000000") == 0 && strcmp(szMask, "00000000") == 0) 66 { 67 fclose(fp); 68 strncpy(pszName, szIfName, 16); 69 pszName[16] = 0; 70 return VINF_SUCCESS; 71 } 69 72 } 70 73 }
Note:
See TracChangeset
for help on using the changeset viewer.