]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
script: Don't assume AF_PACKET of if not AF_LINK
authorRoy Marples <roy@marples.name>
Mon, 1 Jun 2026 21:07:06 +0000 (22:07 +0100)
committerRoy Marples <roy@marples.name>
Mon, 1 Jun 2026 21:07:26 +0000 (22:07 +0100)
src/script.c

index 084b6238a2098d9d819b55318b681530fcd15b3e..f1f2b56d23d2992811cc2308b81efdd7696d845a 100644 (file)
@@ -583,11 +583,13 @@ send_interface(struct fd_list *fd, const struct interface *ifp, int af)
        const struct dhcp6_state *d6;
 #endif
 
-#ifndef AF_LINK
-#define AF_LINK AF_PACKET
+       if (af == AF_UNSPEC
+#if defined(AF_LINK)
+           || af == AF_LINK
+#elif defined(AF_PACKET)
+           || af == AF_PACKET
 #endif
-
-       if (af == AF_UNSPEC || af == AF_LINK) {
+       ) {
                const char *reason;
 
                switch (ifp->carrier) {