From 3f5d7cff1d3e0eacf8549ba559882cd5b144a9fa Mon Sep 17 00:00:00 2001 From: Maximilian Wilhelm Date: Sat, 13 May 2023 22:51:33 +0200 Subject: [PATCH] BGP Peer Role: OTC needs to be set to local ASN Signed-off-by: Maximilian Wilhelm --- routingtable/adjRIBOut/adj_rib_out.go | 2 +- routingtable/adjRIBOut/adj_rib_out_test.go | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/routingtable/adjRIBOut/adj_rib_out.go b/routingtable/adjRIBOut/adj_rib_out.go index 0fe11a6b..506a8216 100644 --- a/routingtable/adjRIBOut/adj_rib_out.go +++ b/routingtable/adjRIBOut/adj_rib_out.go @@ -144,7 +144,7 @@ func (a *AdjRIBOut) checkPropagateUpdateEBGP(pfx *bnet.Prefix, p *route.Path) (r // 1. If peer is Customer, Peer, or RSClient and OTC is not present we MUST add it with our ASN if p.BGPPath.BGPPathA.OnlyToCustomer == 0 && (pr == packet.PeerRoleRoleCustomer || pr == packet.PeerRoleRolePeer || pr == packet.PeerRoleRoleRSClient) { - p.BGPPath.BGPPathA.OnlyToCustomer = a.sessionAttrs.PeerASN + p.BGPPath.BGPPathA.OnlyToCustomer = a.sessionAttrs.LocalASN } } diff --git a/routingtable/adjRIBOut/adj_rib_out_test.go b/routingtable/adjRIBOut/adj_rib_out_test.go index 8ab6c3a4..108514c1 100644 --- a/routingtable/adjRIBOut/adj_rib_out_test.go +++ b/routingtable/adjRIBOut/adj_rib_out_test.go @@ -1601,7 +1601,7 @@ func TestOTC(t *testing.T) { PeerRoleLocal: packet.PeerRoleRoleProvider, PeerRoleAdvByPeer: true, PeerRoleRemote: packet.PeerRoleRoleCustomer, - PeerASN: 41981, + PeerASN: 39225, }, routesAdd: []*route.Route{ route.NewRoute(net.NewPfx(net.IPv4FromOctets(10, 0, 0, 0), 8).Ptr(), &route.Path{ @@ -1648,7 +1648,7 @@ func TestOTC(t *testing.T) { PeerRoleLocal: packet.PeerRoleRolePeer, PeerRoleAdvByPeer: true, PeerRoleRemote: packet.PeerRoleRolePeer, - PeerASN: 41981, + PeerASN: 39225, }, routesAdd: []*route.Route{ route.NewRoute(net.NewPfx(net.IPv4FromOctets(10, 0, 0, 0), 8).Ptr(), &route.Path{ @@ -1695,7 +1695,7 @@ func TestOTC(t *testing.T) { PeerRoleLocal: packet.PeerRoleRoleRS, PeerRoleAdvByPeer: true, PeerRoleRemote: packet.PeerRoleRoleRSClient, - PeerASN: 41981, + PeerASN: 39225, }, routesAdd: []*route.Route{ route.NewRoute(net.NewPfx(net.IPv4FromOctets(10, 0, 0, 0), 8).Ptr(), &route.Path{ @@ -1744,7 +1744,7 @@ func TestOTC(t *testing.T) { PeerRoleLocal: packet.PeerRoleRoleCustomer, PeerRoleAdvByPeer: true, PeerRoleRemote: packet.PeerRoleRoleProvider, - PeerASN: 41981, + PeerASN: 39225, }, routesAdd: []*route.Route{ route.NewRoute(net.NewPfx(net.IPv4FromOctets(10, 0, 0, 0), 8).Ptr(), &route.Path{ @@ -1772,7 +1772,7 @@ func TestOTC(t *testing.T) { PeerRoleLocal: packet.PeerRoleRolePeer, PeerRoleAdvByPeer: true, PeerRoleRemote: packet.PeerRoleRolePeer, - PeerASN: 41981, + PeerASN: 39225, }, routesAdd: []*route.Route{ route.NewRoute(net.NewPfx(net.IPv4FromOctets(10, 0, 0, 0), 8).Ptr(), &route.Path{ @@ -1800,7 +1800,7 @@ func TestOTC(t *testing.T) { PeerRoleLocal: packet.PeerRoleRoleRSClient, PeerRoleAdvByPeer: true, PeerRoleRemote: packet.PeerRoleRoleRS, - PeerASN: 41981, + PeerASN: 39225, }, routesAdd: []*route.Route{ route.NewRoute(net.NewPfx(net.IPv4FromOctets(10, 0, 0, 0), 8).Ptr(), &route.Path{