pkg: allow overriding internal IP
This addresses the request for enhancement in https://github.com/squat/kilo/issues/7.
This commit is contained in:
@@ -505,17 +505,20 @@ func (m *Mesh) checkIn() {
|
||||
}
|
||||
|
||||
func (m *Mesh) handleLocal(n *Node) {
|
||||
// Allow the external IP to be overridden.
|
||||
// Allow the IPs to be overridden.
|
||||
if n.ExternalIP == nil {
|
||||
n.ExternalIP = m.externalIP
|
||||
}
|
||||
if n.InternalIP == nil {
|
||||
n.InternalIP = m.internalIP
|
||||
}
|
||||
// Compare the given node to the calculated local node.
|
||||
// Take leader, location, and subnet from the argument, as these
|
||||
// are not determined by kilo.
|
||||
local := &Node{
|
||||
ExternalIP: n.ExternalIP,
|
||||
Key: m.pub,
|
||||
InternalIP: m.internalIP,
|
||||
InternalIP: n.InternalIP,
|
||||
LastSeen: time.Now().Unix(),
|
||||
Leader: n.Leader,
|
||||
Location: n.Location,
|
||||
|
Reference in New Issue
Block a user