]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix reading netmask and linux informing.
authorRoy Marples <roy@marples.name>
Sat, 18 Oct 2008 18:46:22 +0000 (18:46 +0000)
committerRoy Marples <roy@marples.name>
Sat, 18 Oct 2008 18:46:22 +0000 (18:46 +0000)
if-linux.c
if-options.c

index 738b5ec0113e9cd679a50744637409da974a6f85..bbbc549320d8f03ce96fb62c4912f8ea7f015fd7 100644 (file)
@@ -346,7 +346,7 @@ if_address(const struct interface *iface,
                   iface->name, strlen(iface->name) + 1);
        add_attr_l(&nlm->hdr, sizeof(*nlm), IFA_LOCAL,
                   &address->s_addr, sizeof(address->s_addr));
-       if (action >= 0)
+       if (action >= 0 && broadcast)
                add_attr_l(&nlm->hdr, sizeof(*nlm), IFA_BROADCAST,
                           &broadcast->s_addr, sizeof(broadcast->s_addr));
 
index 85d2bfce647d523d8ec84c230379ae7f220c7cf9..3965119d145b312f4ebf91c55544033bcca2dc2d 100644 (file)
@@ -267,7 +267,7 @@ static int
 parse_option(struct if_options *ifo, int opt, const char *arg)
 {
        int i;
-       char *p;
+       char *p = NULL;
        ssize_t s;
        struct in_addr addr;
 
@@ -376,6 +376,9 @@ parse_option(struct if_options *ifo, int opt, const char *arg)
                               arg);
                        return -1;
                }
+               /* Restore the slash */
+               if (ifo->options & DHCPCD_INFORM && p)
+                       *--p = '/';
                break;
        case 't':
                ifo->timeout = atoint(arg);