mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-05-27 12:52:27 +02:00
cmd/cli: add support for no default route systems
Currently, ctrld requires the default route interface existed to be functional correctly. However, on systems where default route is non existed, or point to a virtual interface (like ipsec based VPN), the fact that the OS is using this interface as default gateway and doesn't actually send things to 127.0.0.1 is not ctrld's problem. In this case, ctrld should just start normally, without worrying about the no default route interface problem.
This commit is contained in:
committed by
Cuong Manh Le
parent
332f8ccc37
commit
5036de2602
+7
-1
@@ -781,7 +781,13 @@ func defaultIfaceName() string {
|
||||
if oi := osinfo.New(); strings.Contains(oi.String(), "Microsoft") {
|
||||
return "lo"
|
||||
}
|
||||
mainLog.Load().Fatal().Err(err).Msg("failed to get default route interface")
|
||||
// On linux, it could be either resolvconf or systemd which is managing DNS settings,
|
||||
// so the interface name does not matter if there's no default route interface.
|
||||
if runtime.GOOS == "linux" {
|
||||
return "lo"
|
||||
}
|
||||
mainLog.Load().Debug().Err(err).Msg("no default route interface found")
|
||||
return ""
|
||||
}
|
||||
return dri
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user