as transport endpoint addresses, so the "sa_data" field includes port
numbers. Revert the IPv4 code; we'll fix the IPv6 code later (we'll
have to check whether "struct sockaddr_in6" is defined, and not support
IPv6 addresses if it's not, even if AF_INET6 is defined).
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11420
f5534014-38df-0310-8fa8-
9805f1628bb7
if_info_add_address(if_info_t *if_info, struct sockaddr *addr)
{
if_addr_t *ip_addr;
+ struct sockaddr_in *ai;
switch (addr->sa_family) {
case AF_INET:
+ ai = (struct sockaddr_in *)addr;
ip_addr = g_malloc(sizeof(*ip_addr));
ip_addr->family = FAM_IPv4;
- memcpy((void *)&ip_addr->ip_addr.ip4_addr,
- (void *)&addr->sa_data, 4);
+ ip_addr->ip_addr.ip4_addr =
+ *((guint32 *)&(ai->sin_addr.s_addr));
if_info->ip_addr = g_slist_append(if_info->ip_addr, ip_addr);
break;