diff options
author | Hitoshi Irino <irino@sfc.wide.ad.jp> | 2019-06-24 00:39:22 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2019-07-02 11:40:22 +0900 |
commit | 2f5a4d59cb8d494bcf1a64d45d84bcd8fd4a7f06 (patch) | |
tree | 130afc174fe85d32abe3ad4994aecec3461ffcc4 /pkg/server/fsm.go | |
parent | 9f936065a907639661eca3924f0a8f09d94abbfe (diff) |
BGP connection on a speecified interface (including which is associated VRF) using syscall SO_BINDTODEVICE
Diffstat (limited to 'pkg/server/fsm.go')
-rw-r--r-- | pkg/server/fsm.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/server/fsm.go b/pkg/server/fsm.go index ae102812..b06ddd5d 100644 --- a/pkg/server/fsm.go +++ b/pkg/server/fsm.go @@ -491,7 +491,7 @@ func (h *fsmHandler) connectLoop(ctx context.Context, wg *sync.WaitGroup) { defer wg.Done() fsm := h.fsm - retry, addr, port, password, ttl, ttlMin, localAddress := func() (int, string, int, string, uint8, uint8, string) { + retry, addr, port, password, ttl, ttlMin, localAddress, bindInterface := func() (int, string, int, string, uint8, uint8, string, string) { fsm.lock.RLock() defer fsm.lock.RUnlock() @@ -518,7 +518,7 @@ func (h *fsmHandler) connectLoop(ctx context.Context, wg *sync.WaitGroup) { ttl = fsm.pConf.EbgpMultihop.Config.MultihopTtl } } - return tick, addr, port, password, ttl, ttlMin, fsm.pConf.Transport.Config.LocalAddress + return tick, addr, port, password, ttl, ttlMin, fsm.pConf.Transport.Config.LocalAddress, fsm.pConf.Transport.Config.BindInterface }() tick := minConnectRetryInterval @@ -553,7 +553,7 @@ func (h *fsmHandler) connectLoop(ctx context.Context, wg *sync.WaitGroup) { LocalAddr: laddr, Timeout: time.Duration(tick-1) * time.Second, Control: func(network, address string, c syscall.RawConn) error { - return dialerControl(network, address, c, ttl, ttlMin, password) + return dialerControl(network, address, c, ttl, ttlMin, password, bindInterface) }, } |