]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: fix routing socket logic for labelled nexthops
authorMark Stapp <mjs@voltanet.io>
Thu, 20 Dec 2018 18:20:49 +0000 (13:20 -0500)
committerMark Stapp <mjs@voltanet.io>
Tue, 22 Jan 2019 20:07:24 +0000 (15:07 -0500)
Clarify and fix the logic used for labelled nexthops during
route updates on routing socket platforms.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
zebra/rt_socket.c

index a6cdffdf3209033dc0ec3e29ef84c23c9f93f421..abcff22b6b183f315370370bdcd4629ad3c9ad7d 100644 (file)
@@ -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,