diff options
author | SUZUKI, Shinsuke <suz@kame.net> | 2007-03-21 18:09:33 +0000 |
---|---|---|
committer | Bjørn Mork <bjorn@mork.no> | 2010-08-06 15:37:36 +0200 |
commit | 484766b9467ac3a3e35eb465da6bfd825f749bd5 (patch) | |
tree | 6d574eb3f07d52b8f4ae146d6e7a12c3c150ab0a /if.c | |
parent | bb3239acbdae547fdc29b5b6337ed58224bc85d7 (diff) |
implemented DHCPv6 Confirm message processing on DHCPv6 server.
Diffstat (limited to 'if.c')
-rw-r--r-- | if.c | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -87,6 +87,34 @@ ifinit(ifname) ifp->authalgorithm = DHCP6_AUTHALG_UNDEF; ifp->authrdm = DHCP6_AUTHRDM_UNDEF; + { + struct ifaddrs *ifa, *ifap; + struct sockaddr_in6 *sin6; + + if (getifaddrs(&ifap) < 0) { + dprintf(LOG_ERR, FNAME, "getifaddrs failed: %s", + strerror(errno)); + goto fail; + } + + for (ifa = ifap; ifa; ifa = ifa->ifa_next) { + if (strcmp(ifa->ifa_name, ifname) != 0) + continue; + if (ifa->ifa_addr == NULL) + continue; + if (ifa->ifa_addr->sa_family != AF_INET6) + continue; + + sin6 = (struct sockaddr_in6 *)ifa->ifa_addr; + if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) + continue; + + ifp->addr = sin6->sin6_addr; + } + + freeifaddrs(ifap); + } + ifp->next = dhcp6_if; dhcp6_if = ifp; return (ifp); |