From fe6c7157bf2babbc552dc45115da586bde1b92e7 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Wed, 21 Sep 2016 23:59:57 -0300 Subject: 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 --- zebra/zebra_mpls_openbsd.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'zebra/zebra_mpls_openbsd.c') diff --git a/zebra/zebra_mpls_openbsd.c b/zebra/zebra_mpls_openbsd.c index 43a54adff1..bae1de66bf 100644 --- a/zebra/zebra_mpls_openbsd.c +++ b/zebra/zebra_mpls_openbsd.c @@ -178,15 +178,15 @@ kernel_del_lsp (zebra_lsp_t *lsp) } #define MAX_RTSOCK_BUF 128 * 1024 -void +int mpls_kernel_init (void) { int rcvbuf, default_rcvbuf; socklen_t optlen; if ((kr_state.fd = socket(AF_ROUTE, SOCK_RAW, 0)) == -1) { - zlog_warn("kr_init: socket"); - return; + zlog_warn("%s: socket", __func__); + return -1; } /* grow receive buffer, don't wanna miss messages */ @@ -203,4 +203,6 @@ mpls_kernel_init (void) ; /* nothing */ kr_state.rtseq = 1; + + return 0; } -- cgit v1.2.3