From b24204be32293646335e86afdf5625811fd5224d Mon Sep 17 00:00:00 2001 From: Mark Stapp Date: Thu, 20 Dec 2018 13:20:49 -0500 Subject: [PATCH] zebra: fix routing socket logic for labelled nexthops Clarify and fix the logic used for labelled nexthops during route updates on routing socket platforms. Signed-off-by: Mark Stapp --- zebra/rt_socket.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/zebra/rt_socket.c b/zebra/rt_socket.c index a6cdffdf32..abcff22b6b 100644 --- a/zebra/rt_socket.c +++ b/zebra/rt_socket.c @@ -213,10 +213,12 @@ static int kernel_rtm(int cmd, const struct prefix *p, } #ifdef __OpenBSD__ - if (nexthop->nh_label - && !kernel_rtm_add_labels(nexthop->nh_label, &smpls)) - continue; - smplsp = (union sockunion *)&smpls; + if (nexthop->nh_label) { + if (kernel_rtm_add_labels(nexthop->nh_label, + &smpls) != 0) + continue; + smplsp = (union sockunion *)&smpls; + } #endif error = rtm_write(cmd, &sin_dest, &sin_mask, gate ? &sin_gate : NULL, smplsp, -- 2.39.5