summaryrefslogtreecommitdiffhomepage
path: root/pkg/server/grpc_server.go
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2021-06-28 18:59:29 +0300
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2021-06-30 10:55:06 +0900
commitc114e04958bf6f303395547a79fbee33a29c8a64 (patch)
tree38929102cea46e6fe670653ce2d804d7a3d29fab /pkg/server/grpc_server.go
parent35ec732d85890c9039192ffa38943135d12b7bcb (diff)
Handle ttl-security option correctly
It wasn't configurable at all. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'pkg/server/grpc_server.go')
-rw-r--r--pkg/server/grpc_server.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/server/grpc_server.go b/pkg/server/grpc_server.go
index b0cae8d3..289ab7ba 100644
--- a/pkg/server/grpc_server.go
+++ b/pkg/server/grpc_server.go
@@ -733,6 +733,10 @@ func newNeighborFromAPIStruct(a *api.Peer) (*config.Neighbor, error) {
pconf.EbgpMultihop.Config.Enabled = a.EbgpMultihop.Enabled
pconf.EbgpMultihop.Config.MultihopTtl = uint8(a.EbgpMultihop.MultihopTtl)
}
+ if a.TtlSecurity != nil {
+ pconf.TtlSecurity.Config.Enabled = a.TtlSecurity.Enabled
+ pconf.TtlSecurity.Config.TtlMin = uint8(a.TtlSecurity.TtlMin)
+ }
if a.State != nil {
pconf.State.SessionState = config.SessionState(strings.ToUpper(string(a.State.SessionState)))
pconf.State.AdminState = config.IntToAdminStateMap[int(a.State.AdminState)]
@@ -836,6 +840,10 @@ func newPeerGroupFromAPIStruct(a *api.PeerGroup) (*config.PeerGroup, error) {
pconf.EbgpMultihop.Config.Enabled = a.EbgpMultihop.Enabled
pconf.EbgpMultihop.Config.MultihopTtl = uint8(a.EbgpMultihop.MultihopTtl)
}
+ if a.TtlSecurity != nil {
+ pconf.TtlSecurity.Config.Enabled = a.TtlSecurity.Enabled
+ pconf.TtlSecurity.Config.TtlMin = uint8(a.TtlSecurity.TtlMin)
+ }
if a.Info != nil {
pconf.State.TotalPaths = a.Info.TotalPaths
pconf.State.TotalPrefixes = a.Info.TotalPrefixes