X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=second%2Ffile.c;fp=second%2Ffile.c;h=aad1ba466e91d30fe040793eba843484313b35a0;hb=19d463913aa7e20a567d5e7fb68b7fd69955b5fc;hp=6b997b0589b0506155088d25d809eca41e02781b;hpb=a9e02f948a7e3f8ada87e07a0c1a382805ad15c6;p=tonyb-yaboot.git diff --git a/second/file.c b/second/file.c index 6b997b0..aad1ba4 100644 --- a/second/file.c +++ b/second/file.c @@ -172,6 +172,7 @@ extract_ipv4_args(char *imagepath, struct boot_fspec_t *result) result->giaddr = is_valid_ipv4_str(scopy(&str, &args)); result->bootp_retries = scopy(&str, &args); result->tftp_retries = scopy(&str, &args); + result->subnetmask = is_valid_ipv4_str(scopy(&str, &args)); if (*args) { result->addl_params = strdup(args); if (!result->addl_params) @@ -237,7 +238,12 @@ extract_vendor_options(struct bootp_packet *packet, struct boot_fspec_t *result) switch (tag) { case DHCP_NETMASK: - /* FIXME: do we need to grok the subnet mask? */ + if ((result->subnetmask == NULL || + *(result->subnetmask) == '\x0') && value != 0) { + result->subnetmask = ipv4_to_str(value); + DEBUG_F("Storing %s as subnetmask from options\n", + result->subnetmask); + } break; case DHCP_ROUTERS: if ((result->giaddr == NULL || *(result->giaddr) == '\x0')