diff options
Diffstat (limited to 'mdk-stage1')
-rw-r--r-- | mdk-stage1/dhcp.c | 7 | ||||
-rw-r--r-- | mdk-stage1/network.c | 5 |
2 files changed, 3 insertions, 9 deletions
diff --git a/mdk-stage1/dhcp.c b/mdk-stage1/dhcp.c index 32c7a932b..bae74c9f4 100644 --- a/mdk-stage1/dhcp.c +++ b/mdk-stage1/dhcp.c @@ -257,13 +257,6 @@ static void parse_reply(struct bootp_request * breq, struct interface_info * int log_message("got gateway %s", inet_ntoa(gateway)); break; - case BOOTP_OPTION_HOSTNAME: - memcpy(tmp_str, chptr, length); - tmp_str[length] = '\0'; - hostname = strdup(tmp_str); - log_message("got hostname %s", hostname); - break; - } chptr += length; diff --git a/mdk-stage1/network.c b/mdk-stage1/network.c index ef9dd2814..e6df5ac52 100644 --- a/mdk-stage1/network.c +++ b/mdk-stage1/network.c @@ -466,9 +466,10 @@ static enum return_type configure_network(struct interface_info * intf) dnshostname = mygethostbyaddr(inet_ntoa(intf->ip)); if (dnshostname) { - hostname = strdup(dnshostname); + if (intf->boot_proto == BOOTPROTO_STATIC) + hostname = strdup(dnshostname); domain = strchr(strdup(hostname), '.') + 1; - log_message("got hostname and domain from dns entry, %s and %s", hostname, domain); + log_message("got hostname and domain from dns entry, %s and %s", dnshostname, domain); return RETURN_OK; } |