Skip to content

Commit

Permalink
bgpd: fix using bgp lu remote label when sending to ibgp peer
Browse files Browse the repository at this point in the history
When redistributing an advertisement from an EBGP peer to an
IBGP peer, and the next-hop is kept unchanged, then the remote
label should be used.

Fix this by checking the 'NEXTHOP_SELF' flag in the ibgp peer.
Fixes: cd1964f ("bgpd: labeled unicast processing")

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Aug 29, 2023
1 parent dccd9ab commit 42f9682
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bgpd/bgp_label.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ mpls_label_t bgp_adv_label(struct bgp_dest *dest, struct bgp_path_info *pi,
reflect =
((from->sort == BGP_PEER_IBGP) && (to->sort == BGP_PEER_IBGP));

if (reflect
&& !CHECK_FLAG(to->af_flags[afi][safi],
PEER_FLAG_FORCE_NEXTHOP_SELF))
if (reflect &&
!CHECK_FLAG(to->af_flags[afi][safi],
PEER_FLAG_FORCE_NEXTHOP_SELF) &&
!CHECK_FLAG(to->af_flags[afi][safi], PEER_FLAG_NEXTHOP_SELF))
return remote_label;

if (CHECK_FLAG(to->af_flags[afi][safi], PEER_FLAG_NEXTHOP_UNCHANGED))
Expand Down

0 comments on commit 42f9682

Please sign in to comment.