ipconfig: Distinguish between IPv4 and IPv6 addresses in normal mode.

oldstable
Vitaly Lipatov 2013-11-18 19:00:10 +04:00 committed by Alexandre Julliard
parent 89bdb2f4da
commit 6ceb564408
1 changed files with 5 additions and 1 deletions

View File

@ -186,8 +186,12 @@ static void print_basic_information(void)
for (addr = p->FirstUnicastAddress; addr; addr = addr->Next)
{
if (socket_address_to_string(addr_buf, sizeof(addr_buf)/sizeof(WCHAR), &addr->Address))
if (addr->Address.lpSockaddr->sa_family == AF_INET &&
socket_address_to_string(addr_buf, sizeof(addr_buf)/sizeof(WCHAR), &addr->Address))
print_field(STRING_IP_ADDRESS, addr_buf);
else if (addr->Address.lpSockaddr->sa_family == AF_INET6 &&
socket_address_to_string(addr_buf, sizeof(addr_buf)/sizeof(WCHAR), &addr->Address))
print_field(STRING_IP6_ADDRESS, addr_buf);
/* FIXME: Output corresponding subnet mask. */
}