diff options
Diffstat (limited to 'networking/udhcp/script.c')
-rw-r--r-- | networking/udhcp/script.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/networking/udhcp/script.c b/networking/udhcp/script.c index 8c4933455..5a4b33a53 100644 --- a/networking/udhcp/script.c +++ b/networking/udhcp/script.c | |||
@@ -149,10 +149,10 @@ static char **fill_envp(struct dhcpMessage *packet) | |||
149 | 149 | ||
150 | envp = xzalloc(sizeof(char *) * (num_options + 5)); | 150 | envp = xzalloc(sizeof(char *) * (num_options + 5)); |
151 | j = 0; | 151 | j = 0; |
152 | envp[j++] = bb_xasprintf("interface=%s", client_config.interface); | 152 | envp[j++] = xasprintf("interface=%s", client_config.interface); |
153 | envp[j++] = bb_xasprintf("PATH=%s", | 153 | envp[j++] = xasprintf("PATH=%s", |
154 | getenv("PATH") ? : "/bin:/usr/bin:/sbin:/usr/sbin"); | 154 | getenv("PATH") ? : "/bin:/usr/bin:/sbin:/usr/sbin"); |
155 | envp[j++] = bb_xasprintf("HOME=%s", getenv("HOME") ? : "/"); | 155 | envp[j++] = xasprintf("HOME=%s", getenv("HOME") ? : "/"); |
156 | 156 | ||
157 | if (packet == NULL) return envp; | 157 | if (packet == NULL) return envp; |
158 | 158 | ||
@@ -170,7 +170,7 @@ static char **fill_envp(struct dhcpMessage *packet) | |||
170 | /* Fill in a subnet bits option for things like /24 */ | 170 | /* Fill in a subnet bits option for things like /24 */ |
171 | if (dhcp_options[i].code == DHCP_SUBNET) { | 171 | if (dhcp_options[i].code == DHCP_SUBNET) { |
172 | memcpy(&subnet, temp, 4); | 172 | memcpy(&subnet, temp, 4); |
173 | envp[j++] = bb_xasprintf("mask=%d", mton(&subnet)); | 173 | envp[j++] = xasprintf("mask=%d", mton(&subnet)); |
174 | } | 174 | } |
175 | } | 175 | } |
176 | if (packet->siaddr) { | 176 | if (packet->siaddr) { |
@@ -180,12 +180,12 @@ static char **fill_envp(struct dhcpMessage *packet) | |||
180 | if (!(over & FILE_FIELD) && packet->file[0]) { | 180 | if (!(over & FILE_FIELD) && packet->file[0]) { |
181 | /* watch out for invalid packets */ | 181 | /* watch out for invalid packets */ |
182 | packet->file[sizeof(packet->file) - 1] = '\0'; | 182 | packet->file[sizeof(packet->file) - 1] = '\0'; |
183 | envp[j++] = bb_xasprintf("boot_file=%s", packet->file); | 183 | envp[j++] = xasprintf("boot_file=%s", packet->file); |
184 | } | 184 | } |
185 | if (!(over & SNAME_FIELD) && packet->sname[0]) { | 185 | if (!(over & SNAME_FIELD) && packet->sname[0]) { |
186 | /* watch out for invalid packets */ | 186 | /* watch out for invalid packets */ |
187 | packet->sname[sizeof(packet->sname) - 1] = '\0'; | 187 | packet->sname[sizeof(packet->sname) - 1] = '\0'; |
188 | envp[j++] = bb_xasprintf("sname=%s", packet->sname); | 188 | envp[j++] = xasprintf("sname=%s", packet->sname); |
189 | } | 189 | } |
190 | return envp; | 190 | return envp; |
191 | } | 191 | } |