summaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorThomas Morin <thomas.morin@orange.com>2016-06-27 18:13:36 +0200
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-06-16 02:17:12 +0900
commit361dcc27da27e0b9ad1e622b280f8c043ff8227b (patch)
tree0063220b6a0c4ea869d25b3418fd1a9d87a7bc5f /server
parent35be0e369469e8c1892dabd73e18743dd3d2dc09 (diff)
Do not crash on RTC wildcard routes
Do not crash and match everything when rt field of a RouteTartgetMembershipNLRI is nil. Bug-Url: #990
Diffstat (limited to 'server')
-rw-r--r--server/server.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/server.go b/server/server.go
index a2662a4d..0bee727e 100644
--- a/server/server.go
+++ b/server/server.go
@@ -267,7 +267,9 @@ func filterpath(peer *Peer, path *table.Path) *table.Path {
for _, ext := range path.GetExtCommunities() {
for _, path := range peer.adjRibIn.PathList([]bgp.RouteFamily{bgp.RF_RTC_UC}, true) {
rt := path.GetNlri().(*bgp.RouteTargetMembershipNLRI).RouteTarget
- if ext.String() == rt.String() {
+ if rt == nil {
+ ignore = false
+ } else if ext.String() == rt.String() {
ignore = false
break
}
@@ -485,7 +487,7 @@ func (server *BgpServer) propagateUpdate(peer *Peer, pathList []*table.Path) []*
paths := make([]*table.Path, 0, len(candidates))
for _, p := range candidates {
for _, ext := range p.GetExtCommunities() {
- if ext.String() == rt.String() {
+ if rt == nil || ext.String() == rt.String() {
if path.IsWithdraw {
p = p.Clone(true)
}