Check valid netmask changes.

This commit is contained in:
Roy Marples 2016-09-02 13:57:42 +00:00
parent 588dc4c044
commit 86189d8e21

8
ipv4.c
View File

@ -1293,9 +1293,11 @@ ipv4_handleifa(struct dhcpcd_ctx *ctx,
TAILQ_INSERT_TAIL(&state->addrs, ia, next);
}
/* Mask could have changed */
ia->mask = *mask;
snprintf(ia->saddr, sizeof(ia->saddr), "%s/%d",
inet_ntoa(*addr), inet_ntocidr(*mask));
if (mask->s_addr != INADDR_ANY) {
ia->mask = *mask;
snprintf(ia->saddr, sizeof(ia->saddr), "%s/%d",
inet_ntoa(*addr), inet_ntocidr(*mask));
}
if (brd != NULL)
ia->brd = *brd;
else