- Timestamp:
- May 28, 2010 9:49:58 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/slirp.c
r29755 r29855 420 420 char buff2[256]; 421 421 RTFILE f; 422 int fFoundNameserver= 0;422 int cNameserversFound = 0; 423 423 int fWarnTooManyDnsServers = 0; 424 424 struct in_addr tmp_addr; … … 469 469 470 470 Log(("NAT: DNS Servers:\n")); 471 while ( RT_SUCCESS(rc = RTFileGets(f, buff, 512, &bytes))471 while ( RT_SUCCESS(rc = RTFileGets(f, buff, sizeof(buff), &bytes)) 472 472 && rc != VERR_EOF) 473 473 { 474 474 struct dns_entry *pDns = NULL; 475 if ( fFoundNameserver== 4475 if ( cNameserversFound == 4 476 476 && fWarnTooManyDnsServers == 0 477 && sscanf(buff, "nameserver%*[ \t]%25 6s", buff2) == 1)477 && sscanf(buff, "nameserver%*[ \t]%255s", buff2) == 1) 478 478 { 479 479 fWarnTooManyDnsServers = 1; 480 480 LogRel(("NAT: too many nameservers registered.\n")); 481 481 } 482 if ( sscanf(buff, "nameserver%*[ \t]%25 6s", buff2) == 1483 && fFoundNameserver< 4) /* Unix doesn't accept more than 4 name servers*/482 if ( sscanf(buff, "nameserver%*[ \t]%255s", buff2) == 1 483 && cNameserversFound < 4) /* Unix doesn't accept more than 4 name servers*/ 484 484 { 485 485 if (!inet_aton(buff2, &tmp_addr)) … … 501 501 } 502 502 TAILQ_INSERT_HEAD(&pData->pDnsList, pDns, de_list); 503 fFoundNameserver++;503 cNameserversFound++; 504 504 } 505 505 if ((!strncmp(buff, "domain", 6) || !strncmp(buff, "search", 6))) … … 534 534 } 535 535 RTFileClose(f); 536 if (! fFoundNameserver)536 if (!cNameserversFound) 537 537 return -1; 538 538 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.