diff options
author | rl1987 <rl1987@sdf.lonestar.org> | 2016-01-06 11:47:31 +0100 |
---|---|---|
committer | rl1987 <rl1987@sdf.lonestar.org> | 2016-01-06 11:47:31 +0100 |
commit | 680d0701e53fe583b2a048b4a3a60f6fea176b64 (patch) | |
tree | 4fe161ff0118817ff4e3e38e7e9737592cda7cb0 | |
parent | 44497e9ebc5231dcdb6a392093f85990fe13542e (diff) | |
download | tor-680d0701e53fe583b2a048b4a3a60f6fea176b64.tar.gz tor-680d0701e53fe583b2a048b4a3a60f6fea176b64.zip |
Tweak ioctl case.
-rw-r--r-- | src/common/address.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/common/address.c b/src/common/address.c index 1e6bb2694a..f12f1403f2 100644 --- a/src/common/address.c +++ b/src/common/address.c @@ -1473,10 +1473,13 @@ get_interface_addresses_ioctl(int severity, sa_family_t family) /* This interface, AFAICT, only supports AF_INET addresses, * except on AIX. For Solaris, we could use SIOCGLIFCONF. */ - /* FIXME: for now, we bail out if family is not AF_INET since + /* Bail out if family is neither AF_INET nor AF_UNSPEC since * ioctl() technique supports non-IPv4 interface addresses on - * a small number of niche systems only. */ - if (family != AF_INET) + * a small number of niche systems only. If family is AF_UNSPEC, + * fall back to getting AF_INET addresses only. */ + if (family == AF_UNSPEC) + family = AF_INET; + else if (family != AF_INET) return NULL; fd = socket(family, SOCK_DGRAM, 0); |