aboutsummaryrefslogtreecommitdiffstats
path: root/pcap-util.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-07-19 01:06:06 +0000
committerGuy Harris <guy@alum.mit.edu>2004-07-19 01:06:06 +0000
commit069592f3c09023674246ef006de99fc6b19b2ea7 (patch)
tree0b0fa750d1ce4476c609594e03e4fb77f8f5d807 /pcap-util.c
parent5c008e38bafeb27bd4398c05d1e4e4e68f916c0f (diff)
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
Diffstat (limited to 'pcap-util.c')
-rw-r--r--pcap-util.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/pcap-util.c b/pcap-util.c
index 2f3e80e6cd..cca74e22ab 100644
--- a/pcap-util.c
+++ b/pcap-util.c
@@ -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