Fixed tailscale node IP dualstack mode in case of IPv4 only node

Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
This commit is contained in:
Roberto Bonafiglia
2023-10-03 12:28:13 +02:00
committed by Roberto Bonafiglia
parent db869dfc23
commit cfb2ef5e3a
2 changed files with 11 additions and 19 deletions

View File

@@ -248,14 +248,8 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
return err
}
logrus.Debugf("Processing vpn node-ip based on the detected nodeIPs: %v", nodeIPs)
dualNode, err := utilsnet.IsDualStackIPs(nodeIPs)
if err != nil {
return errors.Wrapf(err, "failed to validate node-ip: %v", nodeIPs)
}
// If we are in ipv6-only mode, we should pass the ipv6 address. Otherwise, ipv4
if !dualNode && utilsnet.IsIPv6(nodeIPs[0]) {
if utilsnet.IsIPv6(nodeIPs[0]) {
if vpnInfo.IPv6Address != nil {
logrus.Infof("Changed advertise-address to %v due to VPN", vpnInfo.IPv6Address)
if serverConfig.ControlConfig.AdvertiseIP != "" {