Revert the IPv6 code, as we did with the IPv4 code, and use INET6 as an

indicator of whether we have enough IPv6 support to handle IPv6
addresses.

svn path=/trunk/; revision=11425
This commit is contained in:
Guy Harris 2004-07-19 01:06:06 +00:00
parent 5c008e38ba
commit 069592f3c0
1 changed files with 7 additions and 2 deletions

View File

@ -199,6 +199,9 @@ if_info_add_address(if_info_t *if_info, struct sockaddr *addr)
{
if_addr_t *ip_addr;
struct sockaddr_in *ai;
#ifdef INET6
struct sockaddr_in6 *ai6;
#endif
switch (addr->sa_family) {
@ -211,12 +214,14 @@ if_info_add_address(if_info_t *if_info, struct sockaddr *addr)
if_info->ip_addr = g_slist_append(if_info->ip_addr, ip_addr);
break;
#ifdef AF_INET6
#ifdef INET6
case AF_INET6:
ai6 = (struct sockaddr_in6 *)addr;
ip_addr = g_malloc(sizeof(*ip_addr));
ip_addr->family = FAM_IPv6;
memcpy((void *)&ip_addr->ip_addr.ip6_addr,
(void *)&addr->sa_data, 16);
(void *)&ai6->sin6_addr.s6_addr,
sizeof ip_addr->ip_addr.ip6_addr);
if_info->ip_addr = g_slist_append(if_info->ip_addr, ip_addr);
break;
#endif