feat: 多网卡模式支持直接使用网卡 DHCP ip

This commit is contained in:
Mmx233
2022-10-30 14:49:35 +08:00
parent 104c2662b7
commit 547f1fe9d2
2 changed files with 5 additions and 0 deletions

View File

@@ -33,6 +33,10 @@ func Login(localAddr net.Addr, debugOutput bool) error {
return e
}
if localAddr != nil && global.Config.Settings.Basic.UseDhcpIP {
ip = localAddr.(*net.TCPAddr).IP.String()
}
log.Debugln("认证客户端 ip: ", ip)
if online {

View File

@@ -19,6 +19,7 @@ type Basic struct {
SkipCertVerify bool `json:"skip_cert_verify" yaml:"skip_cert_verify" mapstructure:"skip_cert_verify"`
Timeout uint `json:"timeout" yaml:"timeout" mapstructure:"timeout"`
Interfaces string `json:"interfaces" yaml:"interfaces" mapstructure:"interfaces"`
UseDhcpIP bool `json:"use_dhcp_ip" yaml:"use_dhcp_ip" mapstructure:"use_dhcp_ip"`
}
type Log struct {