Some power6 machines need to have the subnetmask to correctly open()
the network device.
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
char* giaddr; /* Gateway address */
char* bootp_retries; /* Bootp retries */
char* tftp_retries; /* TFTP retries */
char* giaddr; /* Gateway address */
char* bootp_retries; /* Bootp retries */
char* tftp_retries; /* TFTP retries */
+ char* subnetmask; /* Subnet mask */
char* addl_params; /* copy all additional parameters */
};
char* addl_params; /* copy all additional parameters */
};
result->giaddr = is_valid_ipv4_str(scopy(&str, &args));
result->bootp_retries = scopy(&str, &args);
result->tftp_retries = scopy(&str, &args);
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)
if (*args) {
result->addl_params = strdup(args);
if (!result->addl_params)
switch (tag) {
case DHCP_NETMASK:
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')
break;
case DHCP_ROUTERS:
if ((result->giaddr == NULL || *(result->giaddr) == '\x0')
strcat(buffer, ",");
strcat(buffer, fspec->tftp_retries);
strcat(buffer, ",");
strcat(buffer, ",");
strcat(buffer, fspec->tftp_retries);
strcat(buffer, ",");
+ strcat(buffer, fspec->subnetmask);
+ strcat(buffer, ",");
strcat(buffer, fspec->addl_params);
} else {
strcat(buffer, ",");
strcat(buffer, fspec->addl_params);
} else {
strcat(buffer, ",");