Skip to content

Commit

Permalink
BGP Peer Role: OTC needs to be set to local ASN
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
  • Loading branch information
BarbarossaTM committed Jun 4, 2023
1 parent c477916 commit 3f5d7cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion routingtable/adjRIBOut/adj_rib_out.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

}
Expand Down
12 changes: 6 additions & 6 deletions routingtable/adjRIBOut/adj_rib_out_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit 3f5d7cf

Please sign in to comment.