summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/network.c
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2004-01-28 14:42:47 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2004-01-28 14:42:47 +0000
commit3ab7d3b66bde9778c8c891fa12607e3dc78c35d7 (patch)
tree15d98bd6c7ce5b3ecedfa9f3402a25f2b78fb724 /mdk-stage1/network.c
parent38e382e82bb1c62e0fd4ca666e6d2f0a15bd113e (diff)
downloaddrakx-backup-do-not-use-3ab7d3b66bde9778c8c891fa12607e3dc78c35d7.tar
drakx-backup-do-not-use-3ab7d3b66bde9778c8c891fa12607e3dc78c35d7.tar.gz
drakx-backup-do-not-use-3ab7d3b66bde9778c8c891fa12607e3dc78c35d7.tar.bz2
drakx-backup-do-not-use-3ab7d3b66bde9778c8c891fa12607e3dc78c35d7.tar.xz
drakx-backup-do-not-use-3ab7d3b66bde9778c8c891fa12607e3dc78c35d7.zip
allow having no DNS by only using the ip callback once, see DNS == IP as a special case, don't do DNS calls when no DNS is configured to avoid timeouts
Diffstat (limited to 'mdk-stage1/network.c')
-rw-r--r--mdk-stage1/network.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/mdk-stage1/network.c b/mdk-stage1/network.c
index 1eb786cc8..13085cfcc 100644
--- a/mdk-stage1/network.c
+++ b/mdk-stage1/network.c
@@ -348,8 +348,12 @@ static void static_ip_callback(char ** strings)
{
struct in_addr addr;
- if (!inet_aton(strings[0], &addr))
+ static int done = 0;
+ if (done)
+ return;
+ if (streq(strings[0], "") || !inet_aton(strings[0], &addr))
return;
+ done = 1;
if (!strcmp(strings[1], "")) {
char * ptr;
@@ -400,6 +404,11 @@ static enum return_type setup_network_interface(struct interface_info * intf)
dns_server.s_addr = 0; /* keep an understandable state */
}
+ if (streq(answers[0], answers[1])) {
+ log_message("IP and DNS are the same, guess you don't want a DNS, disabling it");
+ dns_server.s_addr = 0; /* keep an understandable state */
+ }
+
if (!inet_aton(answers[2], &gateway)) {
log_message("invalid gateway");
gateway.s_addr = 0; /* keep an understandable state */