-
Notifications
You must be signed in to change notification settings - Fork 770
Closed
Description
Doing an action like below will cause an err
peer1 := &api.Peer{
Conf: &api.PeerConf{
NeighborAddress: "127.0.0.1",
PeerAsn: 11111,
},
Transport: &api.Transport{
RemotePort: 10179,
},
Timers: &api.Timers{
Config: &api.TimersConfig{
ConnectRetry: 1,
IdleHoldTimeAfterReset: 1,
},
},
}
myBGPServer.AddPeer(context.Background(), &api.AddPeerRequest{Peer: peer1})
peer2 := &api.Peer{
Conf: &api.PeerConf{
NeighborAddress: "127.0.0.1",
PeerAsn: 22222,
},
Transport: &api.Transport{
RemotePort: 20179,
},
Timers: &api.Timers{
Config: &api.TimersConfig{
ConnectRetry: 1,
IdleHoldTimeAfterReset: 1,
},
},
}
err := myBGPServer.AddPeer(context.Background(), &api.AddPeerRequest{Peer: peer2})
fmt.Println(err)
can't overwrite the existing peer: 127.0.0.1
Because the neighbour map uses address string only as the key. You can bypass this one time on local by changing one of the peers to "localhost". It would be useful (mostly for testing) if the PeerAsn was used as part of the neighbour map key so multiple peers can live at a single address.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels