Josh Gao said "netcat -l -p 12345" broke:

Previously, when trying to listen on a socket without using one of -4,
  -6, or -s, we tried to create an AF_UNSPEC socket, which fails.
This commit is contained in:
Rob Landley 2019-01-02 19:02:32 -06:00
parent 67a2b56b77
commit e95778682a

View File

@ -125,6 +125,10 @@ void netcat_main(void)
} else { } else {
size_t bind_addrlen; size_t bind_addrlen;
// If we weren't given an address with which to resolve which family to
// use, we have to choose.
if (family == AF_UNSPEC) family = AF_INET;
address->sa_family = family; address->sa_family = family;
if (family == AF_INET6) { if (family == AF_INET6) {