diff options
Diffstat (limited to 'networking/udhcp/script.c')
-rw-r--r-- | networking/udhcp/script.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/networking/udhcp/script.c b/networking/udhcp/script.c index 41b680d6b..7876dd3c7 100644 --- a/networking/udhcp/script.c +++ b/networking/udhcp/script.c | |||
@@ -160,8 +160,8 @@ static char **fill_envp(struct dhcpMessage *packet) | |||
160 | if (packet == NULL) | 160 | if (packet == NULL) |
161 | num_options = 0; | 161 | num_options = 0; |
162 | else { | 162 | else { |
163 | for (i = 0; options[i].code; i++) | 163 | for (i = 0; dhcp_options[i].code; i++) |
164 | if (get_option(packet, options[i].code)) | 164 | if (get_option(packet, dhcp_options[i].code)) |
165 | num_options++; | 165 | num_options++; |
166 | if (packet->siaddr) num_options++; | 166 | if (packet->siaddr) num_options++; |
167 | if ((temp = get_option(packet, DHCP_OPTION_OVER))) | 167 | if ((temp = get_option(packet, DHCP_OPTION_OVER))) |
@@ -184,14 +184,15 @@ static char **fill_envp(struct dhcpMessage *packet) | |||
184 | asprintip(&envp[j++], "ip=", (unsigned char *) &packet->yiaddr); | 184 | asprintip(&envp[j++], "ip=", (unsigned char *) &packet->yiaddr); |
185 | 185 | ||
186 | 186 | ||
187 | for (i = 0; options[i].code; i++) { | 187 | for (i = 0; dhcp_options[i].code; i++) { |
188 | if (!(temp = get_option(packet, options[i].code))) | 188 | if (!(temp = get_option(packet, dhcp_options[i].code))) |
189 | continue; | 189 | continue; |
190 | envp[j] = xmalloc(upper_length(temp[OPT_LEN - 2], options[i].flags & TYPE_MASK) + strlen(options[i].name) + 2); | 190 | envp[j] = xmalloc(upper_length(temp[OPT_LEN - 2], |
191 | fill_options(envp[j++], temp, &options[i]); | 191 | dhcp_options[i].flags & TYPE_MASK) + strlen(dhcp_options[i].name) + 2); |
192 | fill_options(envp[j++], temp, &dhcp_options[i]); | ||
192 | 193 | ||
193 | /* Fill in a subnet bits option for things like /24 */ | 194 | /* Fill in a subnet bits option for things like /24 */ |
194 | if (options[i].code == DHCP_SUBNET) { | 195 | if (dhcp_options[i].code == DHCP_SUBNET) { |
195 | memcpy(&subnet, temp, 4); | 196 | memcpy(&subnet, temp, 4); |
196 | asprintf(&envp[j++], "mask=%d", mton(&subnet)); | 197 | asprintf(&envp[j++], "mask=%d", mton(&subnet)); |
197 | } | 198 | } |