summaryrefslogtreecommitdiff
path: root/networking/udhcp/script.c
diff options
context:
space:
mode:
authorDenys Vlasenko2010-03-21 00:43:11 +0100
committerDenys Vlasenko2010-03-21 00:43:11 +0100
commite5ce91b41b657a0dbd1db442ebc47f4c935e7d1f (patch)
treeca7537fff5a9026bdfe5c5c5104b65d6c2a5ebd0 /networking/udhcp/script.c
parent87fa216e1e388c537cda2cff126eea816a4135ac (diff)
downloadbusybox-e5ce91b41b657a0dbd1db442ebc47f4c935e7d1f.zip
busybox-e5ce91b41b657a0dbd1db442ebc47f4c935e7d1f.tar.gz
udhcp: code shrink; disable time and log server options
function old new delta add_server_options - 100 +100 udhcp_add_simple_option 92 90 -2 nobody_responds_to_arp 88 85 -3 dhcp_options 66 62 -4 udhcp_add_option_string 104 94 -10 udhcp_run_script 665 654 -11 dhcp_option_strings 203 188 -15 static.blank_chaddr 16 - -16 send_ACK 211 180 -31 add_bootp_options 61 - -61 udhcpd_main 1925 1846 -79 ------------------------------------------------------------------------------ (add/remove: 1/2 grow/shrink: 0/8 up/down: 100/-232) Total: -132 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/script.c')
-rw-r--r--networking/udhcp/script.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/networking/udhcp/script.c b/networking/udhcp/script.c
index 321b015..b4413fa 100644
--- a/networking/udhcp/script.c
+++ b/networking/udhcp/script.c
@@ -244,14 +244,12 @@ static char **fill_envp(struct dhcp_packet *packet)
}
if (!(over & FILE_FIELD) && packet->file[0]) {
/* watch out for invalid packets */
- packet->file[sizeof(packet->file) - 1] = '\0';
- *curr = xasprintf("boot_file=%s", packet->file);
+ *curr = xasprintf("boot_file=%."DHCP_PKT_FILE_LEN_STR"s", packet->file);
putenv(*curr++);
}
if (!(over & SNAME_FIELD) && packet->sname[0]) {
/* watch out for invalid packets */
- packet->sname[sizeof(packet->sname) - 1] = '\0';
- *curr = xasprintf("sname=%s", packet->sname);
+ *curr = xasprintf("sname=%."DHCP_PKT_SNAME_LEN_STR"s", packet->sname);
putenv(*curr++);
}
return envp;