summaryrefslogtreecommitdiff
path: root/zebra/rt_socket.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2016-09-21 23:59:57 -0300
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-09-23 09:31:25 -0400
commitfe6c7157bf2babbc552dc45115da586bde1b92e7 (patch)
tree3d9792b6a1de0e8c621a4ea7aba1da8b367cf2a7 /zebra/rt_socket.c
parenta4b46f4c16bd4cb1f2c890c08ff541468d59d9b3 (diff)
zebra: check at startup if the kernel supports MPLS
Replace all HAVE_MPLS #ifdef's by a run-time check if MPLS is supported by the kernel or not. This way we don't need to create multiple packages for each OS distribution. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'zebra/rt_socket.c')
-rw-r--r--zebra/rt_socket.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/zebra/rt_socket.c b/zebra/rt_socket.c
index a6a1978065..f23f9d5da3 100644
--- a/zebra/rt_socket.c
+++ b/zebra/rt_socket.c
@@ -21,7 +21,7 @@
*/
#include <zebra.h>
-#if defined HAVE_MPLS && defined __OpenBSD__
+#ifdef __OpenBSD__
#include <netmpls/mpls.h>
#endif
@@ -78,7 +78,7 @@ kernel_rtm_ipv4 (int cmd, struct prefix *p, struct rib *rib, int family)
{
struct sockaddr_in *mask = NULL;
struct sockaddr_in sin_dest, sin_mask, sin_gate;
-#if defined HAVE_MPLS && defined __OpenBSD__
+#ifdef __OpenBSD__
struct sockaddr_mpls smpls;
#endif
union sockunion *smplsp = NULL;
@@ -156,7 +156,7 @@ kernel_rtm_ipv4 (int cmd, struct prefix *p, struct rib *rib, int family)
mask = &sin_mask;
}
-#if defined HAVE_MPLS && defined __OpenBSD__
+#ifdef __OpenBSD__
if (nexthop->nh_label)
{
memset (&smpls, 0, sizeof (smpls));