]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
interfaces: enforce redefinition of IN_IS_ADDR_* macros
authorVincent Bernat <vincent@bernat.im>
Fri, 13 Feb 2015 17:02:16 +0000 (18:02 +0100)
committerVincent Bernat <vincent@bernat.im>
Fri, 13 Feb 2015 17:02:16 +0000 (18:02 +0100)
For IPv4, some definitions may differ from one OS to another. Better
safe than sorry: use the same definition for everyone.

src/daemon/interfaces.c

index c0e03b5d87bc1d78f95d648fa0347f6612bf0308..e2f8c6e9d8cb5ed29e6dab8d56db928ee0dbb321 100644 (file)
@@ -340,19 +340,15 @@ interfaces_helper_chassis(struct lldpd *cfg,
        }
 }
 
-#ifndef IN_IS_ADDR_LOOPBACK
+#undef IN_IS_ADDR_LOOPBACK
 #define IN_IS_ADDR_LOOPBACK(a) ((a)->s_addr == htonl(INADDR_LOOPBACK))
-#endif
-#ifndef IN_IS_ADDR_ANY
+#undef IN_IS_ADDR_ANY
 #define IN_IS_ADDR_ANY(a) ((a)->s_addr == htonl(INADDR_ANY))
-#endif
-#ifndef IN_IS_ADDR_GLOBAL
+#undef IN_IS_ADDR_GLOBAL
 #define IN_IS_ADDR_GLOBAL(a) (!IN_IS_ADDR_LOOPBACK(a) && !IN_IS_ADDR_ANY(a))
-#endif
-#ifndef IN6_IS_ADDR_GLOBAL
+#undef IN6_IS_ADDR_GLOBAL
 #define IN6_IS_ADDR_GLOBAL(a) \
        (!IN6_IS_ADDR_LOOPBACK(a) && !IN6_IS_ADDR_LINKLOCAL(a))
-#endif
 
 /* Find a management address in all available interfaces, even those that were
    already handled. This is a special interface handler because it does not