summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dhcp.c
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2002-03-09 21:59:46 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2002-03-09 21:59:46 +0000
commit80a08532b700fd0229e65d507a5c7f4c7c9716d3 (patch)
treede2ee412a4d167758da000ad296ed4afd8861a85 /mdk-stage1/dhcp.c
parent78178313d76843da793f8fd2a3f472e292aa8d3f (diff)
downloaddrakx-80a08532b700fd0229e65d507a5c7f4c7c9716d3.tar
drakx-80a08532b700fd0229e65d507a5c7f4c7c9716d3.tar.gz
drakx-80a08532b700fd0229e65d507a5c7f4c7c9716d3.tar.bz2
drakx-80a08532b700fd0229e65d507a5c7f4c7c9716d3.tar.xz
drakx-80a08532b700fd0229e65d507a5c7f4c7c9716d3.zip
comply better to ClientID stuff
Diffstat (limited to 'mdk-stage1/dhcp.c')
-rw-r--r--mdk-stage1/dhcp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mdk-stage1/dhcp.c b/mdk-stage1/dhcp.c
index 65b7df56e..d375608f8 100644
--- a/mdk-stage1/dhcp.c
+++ b/mdk-stage1/dhcp.c
@@ -552,9 +552,9 @@ enum return_type perform_dhcp(struct interface_info * intf)
if (*dhcp_hostname && *dhcp_domain) {
/* if we have both, then create client id from them */
- client_id_str = memdup(dhcp_hostname, strlen(dhcp_domain) + 2);
- strcat(client_id_str, ".");
- strcat(client_id_str, dhcp_domain);
+ client_id_str = malloc(1 + strlen(dhcp_hostname) + 1 + strlen(dhcp_domain) + 1);
+ client_id_str[0] = '\0';
+ sprintf(client_id_str+1, "%s.%s", dhcp_hostname, dhcp_domain);
}
}
}
@@ -575,7 +575,7 @@ enum return_type perform_dhcp(struct interface_info * intf)
/* add pieces needed to have DDNS/DHCP IP selection based on requested name */
if (dhcp_hostname && *dhcp_hostname) { /* pick client id form based on absence or presence of domain name */
if (*dhcp_domain) /* alternate style <hostname>.<domainname> */
- add_vendor_code(&breq, DHCP_OPTION_CLIENT_IDENTIFIER, strlen(client_id_str), client_id_str);
+ add_vendor_code(&breq, DHCP_OPTION_CLIENT_IDENTIFIER, strlen(client_id_str+1)+1, client_id_str);
else { /* usual style (aka windows / dhcpcd) */
/* but put MAC in form required for client identifier first */
client_id_hwaddr = malloc(IFHWADDRLEN+2);
@@ -630,7 +630,7 @@ enum return_type perform_dhcp(struct interface_info * intf)
/* if used the first time, then have to use it again */
if (dhcp_hostname && *dhcp_hostname) { /* add pieces needed to have DDNS/DHCP IP selection based on requested name */
if (dhcp_domain && *dhcp_domain) /* alternate style */
- add_vendor_code(&breq, DHCP_OPTION_CLIENT_IDENTIFIER, strlen(client_id_str), client_id_str);
+ add_vendor_code(&breq, DHCP_OPTION_CLIENT_IDENTIFIER, strlen(client_id_str+1)+1, client_id_str);
else /* usual style (aka windows / dhcpcd) */
add_vendor_code(&breq, DHCP_OPTION_CLIENT_IDENTIFIER, IFHWADDRLEN+1, client_id_hwaddr);
/* this is the one that the dhcp server really wants for DDNS updates */