summaryrefslogtreecommitdiffhomepage
path: root/server/fsm.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-01-11 01:51:09 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-01-12 11:00:34 +0900
commitaf2703af93a90e22dc2fa7d1ea44109910d760af (patch)
treeea02c008c99d49097cd8c16345277de837dca2bd /server/fsm.go
parent943e6adb3d19587cf7e737757ea767cb8a9bac0d (diff)
server: don't assume the existence of multiprotocol capability
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server/fsm.go')
-rw-r--r--server/fsm.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/server/fsm.go b/server/fsm.go
index 93fa457a..d853592d 100644
--- a/server/fsm.go
+++ b/server/fsm.go
@@ -581,10 +581,15 @@ func open2Cap(open *bgp.BGPOpen, n *config.Neighbor) (map[bgp.BGPCapabilityCode]
}
}
- for rf, _ := range rfMap {
- if _, y := r[rf]; !y {
- delete(rfMap, rf)
+ if len(r) > 0 {
+ for rf, _ := range rfMap {
+ if _, y := r[rf]; !y {
+ delete(rfMap, rf)
+ }
}
+ } else {
+ rfMap = make(map[bgp.RouteFamily]bool)
+ rfMap[bgp.RF_IPv4_UC] = true
}
return capMap, rfMap
}