diff options
author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2021-06-28 18:59:29 +0300 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2021-06-30 10:55:06 +0900 |
commit | c114e04958bf6f303395547a79fbee33a29c8a64 (patch) | |
tree | 38929102cea46e6fe670653ce2d804d7a3d29fab /pkg/server/grpc_server.go | |
parent | 35ec732d85890c9039192ffa38943135d12b7bcb (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.go | 8 |
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 |