From af2703af93a90e22dc2fa7d1ea44109910d760af Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Mon, 11 Jan 2016 01:51:09 +0900 Subject: server: don't assume the existence of multiprotocol capability Signed-off-by: ISHIDA Wataru --- server/fsm.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'server') 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 } -- cgit v1.2.3