summaryrefslogtreecommitdiffstats
path: root/if.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-05-13 10:31:00 +0000
committerRoy Marples <roy@marples.name>2016-05-13 10:31:00 +0000
commit4632a6f87830f5052c1f02948c26097a213ff612 (patch)
treec6d0f05144dea4d148e83a17362dbd5e1e9d060d /if.c
parent88fe630a139e3875a99fa3f74d04b4e783e8285b (diff)
downloaddhcpcd-4632a6f87830f5052c1f02948c26097a213ff612.tar.xz
If we don't have a broadcast address, set zero on assignment.
Diffstat (limited to 'if.c')
-rw-r--r--if.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/if.c b/if.c
index 7fe4132b..99ac3ca5 100644
--- a/if.c
+++ b/if.c
@@ -211,14 +211,13 @@ 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)
- brd = (const struct sockaddr_in *)
- (void *)ifa->ifa_dstaddr;
+ brd = (void *)ifa->ifa_dstaddr;
else
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, &brd->sin_addr,
- ifa_flags);
+ &addr->sin_addr, &net->sin_addr,
+ brd ? &brd->sin_addr : NULL, ifa_flags);
break;
#endif
#ifdef INET6