Skip to content
Snippets Groups Projects
Commit d4b9ea31 authored by Daniel Czerwonk's avatar Daniel Czerwonk
Browse files

skipping MP when not aggreed to

parent 54c41571
No related branches found
No related tags found
No related merge requests found
......@@ -222,14 +222,7 @@ func (s *establishedState) updates(u *packet.BGPUpdate) {
for r := u.NLRI; r != nil; r = r.Next {
pfx := bnet.NewPfx(bnet.IPv4(r.IP), r.Pfxlen)
path := &route.Path{
Type: route.BGPPathType,
BGPPath: &route.BGPPath{
Source: s.fsm.peer.addr,
EBGP: s.fsm.peer.localASN != s.fsm.peer.peerASN,
},
}
path := s.newRoutePath()
s.processAttributes(u.PathAttributes, path)
s.fsm.adjRIBIn.AddPath(pfx, path)
......@@ -237,14 +230,11 @@ func (s *establishedState) updates(u *packet.BGPUpdate) {
}
func (s *establishedState) multiProtocolUpdates(u *packet.BGPUpdate) {
path := &route.Path{
Type: route.BGPPathType,
BGPPath: &route.BGPPath{
Source: s.fsm.peer.addr,
EBGP: s.fsm.peer.localASN != s.fsm.peer.peerASN,
},
if !s.fsm.options.SupportsMultiProtocol {
return
}
path := s.newRoutePath()
s.processAttributes(u.PathAttributes, path)
for pa := u.PathAttributes; pa != nil; pa = pa.Next {
......@@ -257,6 +247,16 @@ func (s *establishedState) multiProtocolUpdates(u *packet.BGPUpdate) {
}
}
func (s *establishedState) newRoutePath() *route.Path {
return &route.Path{
Type: route.BGPPathType,
BGPPath: &route.BGPPath{
Source: s.fsm.peer.addr,
EBGP: s.fsm.peer.localASN != s.fsm.peer.peerASN,
},
}
}
func (s *establishedState) multiProtocolUpdate(path *route.Path, nlri packet.MultiProtocolReachNLRI) {
for _, pfx := range nlri.Prefixes {
s.fsm.adjRIBIn.AddPath(pfx, path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment