diff options
| author | Roy Marples <roy@marples.name> | 2016-07-26 20:52:31 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2016-07-26 20:52:31 +0000 |
| commit | e83c4813f3eadaf21b58a59378fc5b90886f2010 (patch) | |
| tree | 3e44c3743fddb26114f07583b7217274989a91d9 /if.c | |
| parent | 2cac4f87c91b594dbc710e3caf736f683adcf12d (diff) | |
| download | dhcpcd-e83c4813f3eadaf21b58a59378fc5b90886f2010.tar.xz | |
Simplify handling of IPv6 address from kernel messages, similar to IPv4.
While here, drop the flags argument from the ifa routines.
Instead, grab it in the main ifa handler - it was only for IPv6 addresses
in Linux anyway.
Diffstat (limited to 'if.c')
| -rw-r--r-- | if.c | 15 |
1 files changed, 4 insertions, 11 deletions
@@ -198,8 +198,6 @@ static void if_learnaddrs(struct dhcpcd_ctx *ctx, struct if_head *ifs, #ifdef INET6 struct sockaddr_in6 *sin6, *net6; #endif - int ifa_flags; - for (ifa = ifaddrs; ifa; ifa = ifa->ifa_next) { if (ifa->ifa_addr == NULL) @@ -215,10 +213,9 @@ static void if_learnaddrs(struct dhcpcd_ctx *ctx, struct if_head *ifs, 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 ? &brd->sin_addr : NULL, ifa_flags); + brd ? &brd->sin_addr : NULL); break; #endif #ifdef INET6 @@ -231,13 +228,9 @@ static void if_learnaddrs(struct dhcpcd_ctx *ctx, struct if_head *ifs, sin6->sin6_addr.s6_addr[2] = sin6->sin6_addr.s6_addr[3] = '\0'; #endif - ifa_flags = if_addrflags6(&sin6->sin6_addr, ifp); - if (ifa_flags != -1) - ipv6_handleifa(ctx, RTM_NEWADDR, ifs, - ifa->ifa_name, - &sin6->sin6_addr, - ipv6_prefixlen(&net6->sin6_addr), - ifa_flags); + ipv6_handleifa(ctx, RTM_NEWADDR, ifs, + ifa->ifa_name, &sin6->sin6_addr, + ipv6_prefixlen(&net6->sin6_addr)); break; #endif } |
