diff options
| author | Roy Marples <roy@marples.name> | 2016-04-25 10:58:18 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2016-04-25 10:58:18 +0000 |
| commit | fbf8f9ae3b6ddabe1b1707fd79cf2e7b6879c43e (patch) | |
| tree | 45ab701b76b698244ab3c1bc2030e83ab04adb6a /if.c | |
| parent | 3107d370eb0231e281678b30bf7d7748349ff5e5 (diff) | |
| download | dhcpcd-fbf8f9ae3b6ddabe1b1707fd79cf2e7b6879c43e.tar.xz | |
dst becomes brd as it's makes more sense as we mainly deal with ethernet.
Ensure that handleifa is always passed brd.
If brd does not match existing broadcast address on an existing inet address,
delete it and add our new one.
Diffstat (limited to 'if.c')
| -rw-r--r-- | if.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -192,7 +192,7 @@ static void if_learnaddrs(struct dhcpcd_ctx *ctx, struct if_head *ifs, struct ifaddrs *ifa; struct interface *ifp; #ifdef INET - const struct sockaddr_in *addr, *net, *dst; + const struct sockaddr_in *addr, *net, *brd; #endif #ifdef INET6 struct sockaddr_in6 *sin6, *net6; @@ -211,15 +211,14 @@ static void if_learnaddrs(struct dhcpcd_ctx *ctx, struct if_head *ifs, addr = (void *)ifa->ifa_addr; net = (void *)ifa->ifa_netmask; if (ifa->ifa_flags & IFF_POINTOPOINT) - dst = (const struct sockaddr_in *) + brd = (const struct sockaddr_in *) (void *)ifa->ifa_dstaddr; else - dst = NULL; + brd = (void *)ifa->ifa_broadaddr; ifa_flags = if_addrflags(&addr->sin_addr, ifp); ipv4_handleifa(ctx, RTM_NEWADDR, ifs, ifa->ifa_name, - &addr->sin_addr, - &net->sin_addr, - dst ? &dst->sin_addr : NULL, ifa_flags); + &addr->sin_addr, &net->sin_addr, &brd->sin_addr, + ifa_flags); break; #endif #ifdef INET6 |
