From: Roy Marples Date: Sat, 18 Oct 2008 18:46:22 +0000 (+0000) Subject: Fix reading netmask and linux informing. X-Git-Tag: v5.0.0~214 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58656754e785474455ad470a9b0f83294fc0dd46;p=thirdparty%2Fdhcpcd.git Fix reading netmask and linux informing. --- diff --git a/if-linux.c b/if-linux.c index 738b5ec0..bbbc5493 100644 --- a/if-linux.c +++ b/if-linux.c @@ -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)); diff --git a/if-options.c b/if-options.c index 85d2bfce..3965119d 100644 --- a/if-options.c +++ b/if-options.c @@ -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);