aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-11-01 18:25:15 +0100
committerToni Uhlig <matzeton@googlemail.com>2023-11-06 12:42:32 +0100
commitf5b07efee7ec2ba09b38831773f9b3622d958072 (patch)
treece6bbaf9111de7e6815d2f0284ecf3de6dd3e0d6
parent85a4e32d1b0f804b1982535ee16daa560949e611 (diff)
Fixed invalid use of `SIOCAIFADDR` for `ioctl()`.
* `SIOCGIFALIAS` is the desired one Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r--nDPId.c2
1 files changed, 1 insertions, 1 deletions
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';