Unify ping and ping6. ping has -4 and -6 which force
name resolution into IP or IPv6 only, otherwise we take address family returned by host2sockaddr() in lsa->sa.sa_family. IOW: "ping ::1" with do IPv6 ping, "ping 127.0.0.1" will do IPv4 ping. ping6 is aliased to "ping -6".
This commit is contained in:
parent
677cb5eea5
commit
b9a279ba94
7 changed files with 475 additions and 574 deletions
|
@ -296,10 +296,12 @@ char* xmalloc_sockaddr2host(const struct sockaddr *sa, socklen_t salen)
|
|||
return sockaddr2str(sa, salen, 0);
|
||||
}
|
||||
|
||||
/* Unused
|
||||
char* xmalloc_sockaddr2host_noport(const struct sockaddr *sa, socklen_t salen)
|
||||
{
|
||||
return sockaddr2str(sa, salen, IGNORE_PORT);
|
||||
}
|
||||
*/
|
||||
|
||||
char* xmalloc_sockaddr2hostonly_noport(const struct sockaddr *sa, socklen_t salen)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue