Revision 31a60e22 slirp/slirp.c
b/slirp/slirp.c | ||
---|---|---|
93 | 93 |
if (!f) |
94 | 94 |
return -1; |
95 | 95 |
|
96 |
#ifdef DEBUG |
|
96 | 97 |
lprint("IP address of your DNS(s): "); |
98 |
#endif |
|
97 | 99 |
while (fgets(buff, 512, f) != NULL) { |
98 | 100 |
if (sscanf(buff, "nameserver%*[ \t]%256s", buff2) == 1) { |
99 | 101 |
if (!inet_aton(buff2, &tmp_addr)) |
... | ... | |
103 | 105 |
/* If it's the first one, set it to dns_addr */ |
104 | 106 |
if (!found) |
105 | 107 |
*pdns_addr = tmp_addr; |
108 |
#ifdef DEBUG |
|
106 | 109 |
else |
107 | 110 |
lprint(", "); |
111 |
#endif |
|
108 | 112 |
if (++found > 3) { |
113 |
#ifdef DEBUG |
|
109 | 114 |
lprint("(more)"); |
115 |
#endif |
|
110 | 116 |
break; |
111 |
} else |
|
117 |
} |
|
118 |
#ifdef DEBUG |
|
119 |
else |
|
112 | 120 |
lprint("%s", inet_ntoa(tmp_addr)); |
121 |
#endif |
|
113 | 122 |
} |
114 | 123 |
} |
115 | 124 |
fclose(f); |
Also available in: Unified diff