network/utils: fix ping6
fix ping6 to send ipv6 packet
@@ -405,7 +405,7 @@ static int ping_send(int s, struct sockaddr *to, int size)
static int _set_icmp6_config(struct addrinfo *hints)
{
memset(hints, 0, sizeof(struct addrinfo));
- hints->ai_family = AF_UNSPEC;
+ hints->ai_family = AF_INET6;
hints->ai_socktype = SOCK_RAW;
hints->ai_protocol = IPPROTO_ICMPV6;
return 0;
@@ -414,7 +414,7 @@ static int _set_icmp6_config(struct addrinfo *hints)
static int _set_icmp4_config(struct addrinfo *hints)
{
memset(hints, 0, sizeof(struct addrinfo));
- hints->ai_family = AF_UNSPEC;
+ hints->ai_family = AF_INET;
hints->ai_socktype = SOCK_RAW;
hints->ai_protocol = IPPROTO_ICMP;
return 0;
