]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Only blank out wait options if we are parsing a valid block for us.
authorRoy Marples <roy@marples.name>
Sat, 23 May 2015 13:09:22 +0000 (13:09 +0000)
committerRoy Marples <roy@marples.name>
Sat, 23 May 2015 13:09:22 +0000 (13:09 +0000)
Another fix for [1972d664c2].

if-options.c

index 859a143ad22388920a77fe5d18dd24d883e0de4b..e231d3512a82e7b09c116e2d4cbcc9ee6aace6e9 100644 (file)
@@ -2271,6 +2271,7 @@ read_config(struct dhcpcd_ctx *ctx,
 
        ldop = edop = NULL;
        skip = have_profile = new_block = 0;
+       had_block = ifname == NULL ? 1 : 0;
        while ((line = get_line(&buf, &buflen, fp))) {
                option = strsep(&line, " \t");
                if (line)
@@ -2283,7 +2284,7 @@ read_config(struct dhcpcd_ctx *ctx,
                            *(p - 1) != '\\')
                                *p-- = '\0';
                }
-               if (new_block) {
+               if (skip == 0 && new_block) {
                        had_block = 1;
                        new_block = 0;
                        ifo->options &= ~DHCPCD_WAITOPTS;