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 Jun 20, 2023
1 parent 2be9ce6 commit 6ea3e6e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bgpd/bgp_label.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ mpls_label_t bgp_adv_label(struct bgp_dest *dest, struct bgp_path_info *pi,
PEER_FLAG_FORCE_NEXTHOP_SELF))
return remote_label;

if (from->sort == BGP_PEER_IBGP &&
!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))
return remote_label;

Expand Down

0 comments on commit 6ea3e6e

Please sign in to comment.