diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-01-11 01:51:09 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-01-12 11:00:34 +0900 |
commit | af2703af93a90e22dc2fa7d1ea44109910d760af (patch) | |
tree | ea02c008c99d49097cd8c16345277de837dca2bd /server/fsm.go | |
parent | 943e6adb3d19587cf7e737757ea767cb8a9bac0d (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.go | 11 |
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 } |