mirror of
https://github.com/outbackdingo/nDPId.git
synced 2026-01-27 18:19:39 +00:00
Fixed invalid use of SIOCAIFADDR for ioctl().
* `SIOCGIFALIAS` is the desired one Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
2
nDPId.c
2
nDPId.c
@@ -1069,7 +1069,7 @@ static int get_ip4_address_and_netmask(char const * const ifa_name, size_t ifnam
|
||||
#if defined(__FreeBSD__) || defined(__APPLE__)
|
||||
memcpy(ifr.ifra_name, ifa_name, ifnamelen);
|
||||
ifr.ifra_name[ifnamelen] = '\0';
|
||||
if (ioctl(sock, SIOCAIFADDR, &ifr) == -1)
|
||||
if (ioctl(sock, SIOCGIFALIAS, &ifr) == -1)
|
||||
#else
|
||||
memcpy(ifr.ifr_name, ifa_name, ifnamelen);
|
||||
ifr.ifr_name[ifnamelen] = '\0';
|
||||
|
||||
Reference in New Issue
Block a user