diff options
| author | Mark Stapp <mjs@voltanet.io> | 2018-12-20 13:20:49 -0500 | 
|---|---|---|
| committer | Mark Stapp <mjs@voltanet.io> | 2019-01-22 15:07:24 -0500 | 
| commit | b24204be32293646335e86afdf5625811fd5224d (patch) | |
| tree | fc09d64586a12df01d2ce81916b4a3b5de535cc4 /zebra/rt_socket.c | |
| parent | 683c06ad2281247645016e690e233c65d9475d20 (diff) | |
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 <mjs@voltanet.io>
Diffstat (limited to 'zebra/rt_socket.c')
| -rw-r--r-- | zebra/rt_socket.c | 10 | 
1 files 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,  | 
