diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/fsm.go | 5 | ||||
-rw-r--r-- | server/peer.go | 5 | ||||
-rw-r--r-- | server/server.go | 3 |
3 files changed, 10 insertions, 3 deletions
diff --git a/server/fsm.go b/server/fsm.go index 7bced26c..749c925b 100644 --- a/server/fsm.go +++ b/server/fsm.go @@ -221,6 +221,11 @@ func (fsm *FSM) connectLoop() error { conn, err := net.DialTimeout("tcp", host, time.Duration(MIN_CONNECT_RETRY-1)*time.Second) if err == nil { + isEBGP := fsm.globalConfig.As != fsm.peerConfig.PeerAs + if isEBGP { + ttl := 1 + SetTcpTTLSockopts(conn.(*net.TCPConn), ttl) + } fsm.connCh <- conn } else { log.WithFields(log.Fields{ diff --git a/server/peer.go b/server/peer.go index 56ce7e17..3e5888f0 100644 --- a/server/peer.go +++ b/server/peer.go @@ -193,6 +193,11 @@ func (peer *Peer) startFSMHandler(incoming chan *fsmMsg) { } func (peer *Peer) PassConn(conn *net.TCPConn) { + isEBGP := peer.globalConfig.As != peer.config.PeerAs + if isEBGP { + ttl := 1 + SetTcpTTLSockopts(conn, ttl) + } select { case peer.fsm.connCh <- conn: default: diff --git a/server/server.go b/server/server.go index b2d5a293..29f3a1fd 100644 --- a/server/server.go +++ b/server/server.go @@ -95,9 +95,6 @@ func listenAndAccept(proto string, port int, ch chan *net.TCPConn) (*net.TCPList log.Info(err) continue } - // TODO: check ebgp or not - ttl := 1 - SetTcpTTLSockopts(conn, ttl) ch <- conn } }() |