Changed nodeLink to setupLink

This commit is contained in:
Milos Gajdos
2019-08-15 19:24:24 +01:00
parent f120452d28
commit 67215ae5da

View File

@@ -141,7 +141,7 @@ func (t *tun) monitor() {
for _, node := range t.options.Nodes { for _, node := range t.options.Nodes {
t.Lock() t.Lock()
if _, ok := t.links[node]; !ok { if _, ok := t.links[node]; !ok {
link, err := t.nodeLink(node) link, err := t.setupLink(node)
if err != nil { if err != nil {
log.Debugf("Tunnel failed to establish node link to %s: %v", node, err) log.Debugf("Tunnel failed to establish node link to %s: %v", node, err)
continue continue
@@ -365,9 +365,9 @@ func (t *tun) keepalive(link *link) {
} }
} }
// nodeLink attempts to connect to node and returns link if successful // setupLink connects to node and returns link if successful
// it returns error if the link failed to be established // It returns error if the link failed to be established
func (t *tun) nodeLink(node string) (*link, error) { func (t *tun) setupLink(node string) (*link, error) {
log.Debugf("Tunnel dialing %s", node) log.Debugf("Tunnel dialing %s", node)
c, err := t.options.Transport.Dial(node) c, err := t.options.Transport.Dial(node)
if err != nil { if err != nil {
@@ -454,7 +454,7 @@ func (t *tun) connect() error {
} }
// connect to node and return link // connect to node and return link
link, err := t.nodeLink(node) link, err := t.setupLink(node)
if err != nil { if err != nil {
log.Debugf("Tunnel failed to establish node link to %s: %v", node, err) log.Debugf("Tunnel failed to establish node link to %s: %v", node, err)
continue continue