diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-06-16 09:40:12 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-06-23 18:13:19 +0900 |
commit | bb562572bc24b8b98a55327c582991ce2b9c20af (patch) | |
tree | 043013ee05f9cbdedea382e8a99830e414289af7 /server | |
parent | bc3e06a55fbebd391525d8ce13f84e59cfe8060e (diff) |
server: Enable to configure static TTL for BGP packets
Like "ttl" configuration of Junos OS, this patch enables to set static
TTL value for outgoing BGP packets.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'server')
-rw-r--r-- | server/fsm.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/fsm.go b/server/fsm.go index 4f19bc39..afd04b3e 100644 --- a/server/fsm.go +++ b/server/fsm.go @@ -493,10 +493,15 @@ func (h *FSMHandler) active() (bgp.FSMState, FsmStateReason) { ttl = 255 ttlMin = int(fsm.pConf.TtlSecurity.Config.TtlMin) } else if fsm.pConf.Config.PeerAs != 0 && fsm.pConf.Config.PeerType == config.PEER_TYPE_EXTERNAL { - ttl = 1 if fsm.pConf.EbgpMultihop.Config.Enabled { ttl = int(fsm.pConf.EbgpMultihop.Config.MultihopTtl) + } else if fsm.pConf.Transport.Config.Ttl != 0 { + ttl = int(fsm.pConf.Transport.Config.Ttl) + } else { + ttl = 1 } + } else if fsm.pConf.Transport.Config.Ttl != 0 { + ttl = int(fsm.pConf.Transport.Config.Ttl) } if ttl != 0 { if err := SetTcpTTLSockopts(conn.(*net.TCPConn), ttl); err != nil { |