From 265646c85faa6a691a9d84aaa98f12efc76f6a96 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Wed, 21 Aug 2024 16:16:31 +0200 Subject: [PATCH] Fix IFF_UP being undefined. --- libc/ifaddrs/getifaddrs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libc/ifaddrs/getifaddrs.c b/libc/ifaddrs/getifaddrs.c index dfdec8fa..5dcef04c 100644 --- a/libc/ifaddrs/getifaddrs.c +++ b/libc/ifaddrs/getifaddrs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017 Jonas 'Sortie' Termansen. + * Copyright (c) 2016, 2017, 2024 Jonas 'Sortie' Termansen. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -66,9 +66,10 @@ int getifaddrs(struct ifaddrs** ifas_ptr) freeifaddrs(ifas); return -1; } - struct if_status status; struct if_config cfg; - if ( ioctl(fd, NIOC_GETCONFIG, &cfg) < 0 ) + struct if_status status; + if ( ioctl(fd, NIOC_GETCONFIG, &cfg) < 0 || + ioctl(fd, NIOC_GETSTATUS, &status) < 0 ) { close(fd); if_freenameindex(ifs);