mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-30 10:52:50 +00:00
ping: Fix protocol selection with NOINET6 kernel.
A missing else caused the correct resolver hint (AF_INET) to be
overwritten with AF_UNSPEC when the kernel supports IPv4 but not
IPv6.
MFC after: 3 days
PR: 277592
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D44304
(cherry picked from commit b53ae8a833
)
This commit is contained in:
parent
d463f7c7a7
commit
4187a7dbbe
@ -126,7 +126,7 @@ main(int argc, char *argv[])
|
||||
hints.ai_socktype = SOCK_RAW;
|
||||
if (feature_present("inet") && !feature_present("inet6"))
|
||||
hints.ai_family = AF_INET;
|
||||
if (feature_present("inet6") && !feature_present("inet"))
|
||||
else if (feature_present("inet6") && !feature_present("inet"))
|
||||
hints.ai_family = AF_INET6;
|
||||
else
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
|
Loading…
Reference in New Issue
Block a user