]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Parse subnet_mask= static option instead of deriving from ip_address=
authorRoy Marples <roy@marples.name>
Tue, 22 Mar 2011 12:18:47 +0000 (12:18 +0000)
committerRoy Marples <roy@marples.name>
Tue, 22 Mar 2011 12:18:47 +0000 (12:18 +0000)
if-options.c

index 88b43d7b5085756ad19bc0865ea641610aecce81..8211e7896f9747a78bc5b8097af0fb05e4065da7 100644 (file)
@@ -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 ||