summaryrefslogtreecommitdiffhomepage
path: root/server/fsm.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-02-28 14:51:24 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-02-29 15:41:37 -0800
commit53c5bc0258cede44d3544270309b6dd2e83cf058 (patch)
tree2e6c9bcc1e75f53cd219d3b18259b3dc634b2eef /server/fsm.go
parent7dd4813776f4ef12b2b76d42e519d7193956fe3a (diff)
server: support active connection with md5 protection
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server/fsm.go')
-rw-r--r--server/fsm.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/server/fsm.go b/server/fsm.go
index a18901a5..e4007764 100644
--- a/server/fsm.go
+++ b/server/fsm.go
@@ -313,7 +313,14 @@ func (fsm *FSM) connectLoop() error {
}
} else {
- conn, err := net.DialTimeout("tcp", host, time.Duration(MIN_CONNECT_RETRY-1)*time.Second)
+ var conn net.Conn
+ var err error
+ if fsm.pConf.Config.AuthPassword != "" {
+ deadline := (MIN_CONNECT_RETRY - 1) * 1000 // msec
+ conn, err = DialTCPTimeoutWithMD5Sig(addr, bgp.BGP_PORT, fsm.pConf.Config.AuthPassword, deadline)
+ } else {
+ conn, err = net.DialTimeout("tcp", host, time.Duration(MIN_CONNECT_RETRY-1)*time.Second)
+ }
if err == nil {
fsm.connCh <- conn
} else {