diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/fsm.go | 12 | ||||
-rw-r--r-- | server/peer.go | 4 |
2 files changed, 7 insertions, 9 deletions
diff --git a/server/fsm.go b/server/fsm.go index 0191f9d3..6c048acd 100644 --- a/server/fsm.go +++ b/server/fsm.go @@ -225,11 +225,6 @@ func (fsm *FSM) connectLoop() error { conn, err := net.DialTimeout("tcp", host, time.Duration(MIN_CONNECT_RETRY-1)*time.Second) if err == nil { - isEBGP := fsm.gConf.GlobalConfig.As != fsm.pConf.NeighborConfig.PeerAs - if isEBGP { - ttl := 1 - SetTcpTTLSockopts(conn.(*net.TCPConn), ttl) - } fsm.connCh <- conn } else { log.WithFields(log.Fields{ @@ -341,6 +336,13 @@ func (h *FSMHandler) active() bgp.FSMState { break } fsm.conn = conn + if fsm.gConf.GlobalConfig.As != fsm.pConf.NeighborConfig.PeerAs { + ttl := 1 + if fsm.pConf.EbgpMultihop.EbgpMultihopConfig.Enabled == true { + ttl = int(fsm.pConf.EbgpMultihop.EbgpMultihopConfig.MultihopTtl) + } + SetTcpTTLSockopts(conn.(*net.TCPConn), ttl) + } // we don't implement delayed open timer so move to opensent right // away. return bgp.BGP_FSM_OPENSENT diff --git a/server/peer.go b/server/peer.go index 80d4d0dc..fef1aa07 100644 --- a/server/peer.go +++ b/server/peer.go @@ -226,10 +226,6 @@ func (peer *Peer) startFSMHandler(incoming chan *fsmMsg) { } func (peer *Peer) PassConn(conn *net.TCPConn) { - if peer.isEBGPPeer() { - ttl := 1 - SetTcpTTLSockopts(conn, ttl) - } select { case peer.fsm.connCh <- conn: default: |