mirror of
https://github.com/gravitl/netmaker.git
synced 2025-02-27 01:23:00 +08:00
adding comments, removing bad check
This commit is contained in:
parent
6a90cd803a
commit
91ca96534b
2 changed files with 2 additions and 3 deletions
|
@ -212,7 +212,7 @@ func GetPeerUpdate(node *models.Node) (models.PeerUpdate, error) {
|
||||||
} else {
|
} else {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if node.LocalListenPort != peer.LocalListenPort && peer.LocalListenPort != 0 {
|
if peer.LocalListenPort != 0 {
|
||||||
peer.ListenPort = peer.LocalListenPort
|
peer.ListenPort = peer.LocalListenPort
|
||||||
} else {
|
} else {
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -2,7 +2,6 @@ package functions
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"log"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
@ -28,6 +27,7 @@ func GetLocalListenPort(ifacename string) (int32, error) {
|
||||||
return int32(i), nil
|
return int32(i), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UpdateLocalListenPort - check local port, if different, mod config and publish
|
||||||
func UpdateLocalListenPort(nodeCfg *config.ClientConfig) error {
|
func UpdateLocalListenPort(nodeCfg *config.ClientConfig) error {
|
||||||
var err error
|
var err error
|
||||||
ifacename := getRealIface(nodeCfg.Node.Interface, nodeCfg.Node.Address)
|
ifacename := getRealIface(nodeCfg.Node.Interface, nodeCfg.Node.Address)
|
||||||
|
@ -41,7 +41,6 @@ func UpdateLocalListenPort(nodeCfg *config.ClientConfig) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.Println("server: " + nodeCfg.Server.Server)
|
|
||||||
if err := PublishNodeUpdate(nodeCfg); err != nil {
|
if err := PublishNodeUpdate(nodeCfg); err != nil {
|
||||||
logger.Log(0, "could not publish local port change")
|
logger.Log(0, "could not publish local port change")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue