From f5b07efee7ec2ba09b38831773f9b3622d958072 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Wed, 1 Nov 2023 18:25:15 +0100 Subject: [PATCH] Fixed invalid use of `SIOCAIFADDR` for `ioctl()`. * `SIOCGIFALIAS` is the desired one Signed-off-by: Toni Uhlig --- nDPId.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nDPId.c b/nDPId.c index 479124c4e..c9c66facf 100644 --- a/nDPId.c +++ b/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';