]> The Tcpdump Group git mirrors - tcpdump/commitdiff
From Gisle Vanem: don't do the IN6_IS_ADDR_UNSPECIFIED stuff unless it's
authorguy <guy>
Tue, 4 Jan 2005 00:15:54 +0000 (00:15 +0000)
committerguy <guy>
Tue, 4 Jan 2005 00:15:54 +0000 (00:15 +0000)
not defined, and, if it isn't and _MSC_VER also isn't defined, just
define a IN6_IS_ADDR_UNSPECIFIED() function, rather than, on MinGW,
defining an IN6_ADDR_EQUAL() function and defining
IN6_IS_ADDR_UNSPECIFIED() in terms of it.

print-ripng.c

index 54a89d3d0cbd56aec39781107af9644b5a9d7d5e..cef39daf1e0c9a0a3ba29b89e255d69a4bf332f9 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ripng.c,v 1.17 2003-11-16 09:36:34 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ripng.c,v 1.18 2005-01-04 00:15:54 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -31,22 +31,6 @@ static const char rcsid[] _U_ =
 #ifdef INET6
 
 #include <tcpdump-stdinc.h>
 #ifdef INET6
 
 #include <tcpdump-stdinc.h>
-
-#ifdef WIN32
-const struct in6_addr in6addr_any;        /* :: */
-#endif /* WIN32 */
-
-#ifdef __MINGW32__
-int
-IN6_ADDR_EQUAL(const struct in6_addr *a, const struct in6_addr *b)
-{
-    return (memcmp(a, b, sizeof(struct in6_addr)) == 0);
-}
-
-#define IN6_IS_ADDR_UNSPECIFIED(a) IN6_ADDR_EQUAL((a), &in6addr_any)
-
-#endif /* __MINGW32__ */
-
 #include <stdio.h>
 
 #include "route6d.h"
 #include <stdio.h>
 
 #include "route6d.h"
@@ -54,6 +38,14 @@ IN6_ADDR_EQUAL(const struct in6_addr *a, const struct in6_addr *b)
 #include "addrtoname.h"
 #include "extract.h"
 
 #include "addrtoname.h"
 #include "extract.h"
 
+#if !defined(IN6_IS_ADDR_UNSPECIFIED) && !defined(_MSC_VER) /* MSVC inline */
+static int IN6_IS_ADDR_UNSPECIFIED(const struct in6_addr *addr)
+{
+    static const struct in6_addr in6addr_any;        /* :: */
+    return (memcmp(addr, &in6addr_any, sizeof(*addr)) == 0);
+}
+#endif
+
 static int
 rip6_entry_print(register const struct netinfo6 *ni, int metric)
 {
 static int
 rip6_entry_print(register const struct netinfo6 *ni, int metric)
 {