summaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-07-29 17:14:00 +0000
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-04-04 22:07:46 +0900
commit00f8406cb6a207341ea4f68a8fa294f31eb7bc7b (patch)
treee423c96b98f08c9254e62e3dc689ba04d97c8059 /server
parent806e4c250b1eca27162b1515a7f6b712c9b79f1e (diff)
packet/bgp: add extended-nexthop capability
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r--server/fsm.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/server/fsm.go b/server/fsm.go
index 2f93ff03..e680f8ec 100644
--- a/server/fsm.go
+++ b/server/fsm.go
@@ -561,6 +561,21 @@ func capabilitiesFromConfig(pConf *config.Neighbor) []bgp.ParameterCapabilityInt
caps = append(caps, bgp.NewCapLongLivedGracefulRestart(ltuples))
}
}
+
+ // unnumbered BGP
+ if pConf.Config.NeighborInterface != "" {
+ tuples := []*bgp.CapExtendedNexthopTuple{}
+ families, _ := config.AfiSafis(pConf.AfiSafis).ToRfList()
+ for _, family := range families {
+ if family == bgp.RF_IPv6_UC {
+ continue
+ }
+ tuple := bgp.NewCapExtendedNexthopTuple(family, bgp.AFI_IP6)
+ tuples = append(tuples, tuple)
+ }
+ cap := bgp.NewCapExtendedNexthop(tuples)
+ caps = append(caps, cap)
+ }
return caps
}