aboutsummaryrefslogtreecommitdiffstats
path: root/pcap-util.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-07-19 01:06:06 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-07-19 01:06:06 +0000
commita7a794fe66d46ac45e2ec64a3b4ae6f153fb0895 (patch)
tree0b0fa750d1ce4476c609594e03e4fb77f8f5d807 /pcap-util.c
parent6783d2576f46e8b69a6fdda28a8f3517607b3a2e (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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11425 f5534014-38df-0310-8fa8-9805f1628bb7
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