From: Roy Marples Date: Tue, 22 Mar 2011 12:18:47 +0000 (+0000) Subject: Parse subnet_mask= static option instead of deriving from ip_address= X-Git-Tag: v5.2.12~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=776961cf83bce6ce44f4491e3bf1aca1019184cd;p=thirdparty%2Fdhcpcd.git Parse subnet_mask= static option instead of deriving from ip_address= --- diff --git a/if-options.c b/if-options.c index 88b43d7b..8211e789 100644 --- a/if-options.c +++ b/if-options.c @@ -625,11 +625,16 @@ parse_option(struct if_options *ifo, int opt, const char *arg) } p++; if (strncmp(arg, "ip_address=", strlen("ip_address=")) == 0) { - if (parse_addr(&ifo->req_addr, &ifo->req_mask, p) != 0) + if (parse_addr(&ifo->req_addr, + ifo->req_mask.s_addr == 0 ? &ifo->req_mask : NULL, + p) != 0) return -1; ifo->options |= DHCPCD_STATIC; ifo->options &= ~DHCPCD_INFORM; + } else if (strncmp(arg, "subnet_mask=", strlen("subnet_mask=")) == 0) { + if (parse_addr(&ifo->req_mask, NULL, p) != 0) + return -1; } else if (strncmp(arg, "routes=", strlen("routes=")) == 0 || strncmp(arg, "static_routes=", strlen("static_routes=")) == 0 || strncmp(arg, "classless_static_routes=", strlen("classless_static_routes=")) == 0 ||