summaryrefslogtreecommitdiffstats
path: root/zebra/kernel_socket.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2018-12-05 14:50:25 +0100
committerRafael Zalamena <rzalamena@opensourcerouting.org>2018-12-05 14:56:10 +0100
commitcb800e3529aa19d36565acda41c79cb0b19a1d3b (patch)
tree98dc96465979f36bbbd75e7cf18041ba1cd4fd4d /zebra/kernel_socket.c
parentMerge pull request #3372 from nitinsoniism/show_evpn_mac_vni_all_detail (diff)
downloadfrr-cb800e3529aa19d36565acda41c79cb0b19a1d3b.tar.xz
frr-cb800e3529aa19d36565acda41c79cb0b19a1d3b.zip
zebra: always define ROUNDUP and ROUND_TYPE
Move the declaration of ROUNDUP and ROUND_TYPE to outside of `ifdef SA_SIZE`. We'll use these definitions in the next commit. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'zebra/kernel_socket.c')
-rw-r--r--zebra/kernel_socket.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c
index dcc22d216..25c6e6c64 100644
--- a/zebra/kernel_socket.c
+++ b/zebra/kernel_socket.c
@@ -64,17 +64,18 @@ extern struct zebra_privs_t zserv_privs;
* 0). We follow this practice without questioning it, but it is a
* bug if quagga calls ROUNDUP with 0.
*/
+#ifdef __APPLE__
+#define ROUNDUP_TYPE int
+#else
+#define ROUNDUP_TYPE long
+#endif
/*
* Because of these varying conventions, the only sane approach is for
* the <net/route.h> header to define some flavor of ROUNDUP macro.
*/
-#if defined(SA_SIZE)
-/* SAROUNDUP is the only thing we need, and SA_SIZE provides that */
-#define SAROUNDUP(a) SA_SIZE(a)
-#else /* !SA_SIZE */
-
+/* OS X (Xcode as of 2014-12) is known not to define RT_ROUNDUP */
#if defined(RT_ROUNDUP)
#define ROUNDUP(a) RT_ROUNDUP(a)
#endif /* defined(RT_ROUNDUP) */
@@ -96,20 +97,17 @@ extern struct zebra_privs_t zserv_privs;
* have it in its headers, this will break rather obviously and you'll
* have to fix it here.
*/
-
-/* OS X (Xcode as of 2014-12) is known not to define RT_ROUNDUP */
-#ifdef __APPLE__
-#define ROUNDUP_TYPE int
-#else
-#define ROUNDUP_TYPE long
-#endif
-
#define ROUNDUP(a) \
((a) > 0 ? (1 + (((a)-1) | (sizeof(ROUNDUP_TYPE) - 1))) \
: sizeof(ROUNDUP_TYPE))
#endif /* defined(ROUNDUP) */
+
+#if defined(SA_SIZE)
+/* SAROUNDUP is the only thing we need, and SA_SIZE provides that */
+#define SAROUNDUP(a) SA_SIZE(a)
+#else /* !SA_SIZE */
/*
* Given a pointer (sockaddr or void *), return the number of bytes
* taken up by the sockaddr and any padding needed for alignment.