feat: 支持使用 flag 强制指定单网卡模式 client ip

This commit is contained in:
Mmx233
2022-10-30 14:51:46 +08:00
parent 547f1fe9d2
commit 1cfd756722
2 changed files with 5 additions and 0 deletions

View File

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