[quagga-dev 10628] [PATCH] lib: unconditionally include stddef.h

David Lamparter equinox at opensourcerouting.org
Tue Jul 30 14:38:44 BST 2013


I've used offsetof() in the previous commit to paper over the security
problems in ospf_api.c.  This blows the build on FreeBSD 7.0, missing
offsetof().  Let's add that to zebra's generally used includes.

stddef.h (and offsetof) is defined in C89 section 4.1.5 (and not
deprecated/removed by any later standard).  If this causes problems, the
bug report should go against the host OS/compiler...

Signed-off-by: David Lamparter <equinox at opensourcerouting.org>
---

Let's call this a herpderp moment ;)
[some of you may have seen 0.99.22.2 tagged/tarballed (I hadn't announced
it yet).  I'll wipe that and 0.99.22.3 will be there instead with this fix.]
 -David

 lib/zebra.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/zebra.h b/lib/zebra.h
index ffca7a8..780e12e 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -40,6 +40,7 @@ typedef int socklen_t;
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <stddef.h>
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -175,7 +176,6 @@ typedef int socklen_t;
 #include <linux/netlink.h>
 #include <linux/rtnetlink.h>
 #include <linux/filter.h>
-#include <stddef.h>
 #else
 #define RT_TABLE_MAIN		0
 #endif /* HAVE_NETLINK */
-- 
1.8.1.5





More information about the Quagga-dev mailing list