This commit is contained in:
octeep 2022-03-28 17:25:51 +01:00 committed by octeep
parent e663f3d412
commit 9f0fe5d20d

View file

@ -226,7 +226,7 @@ persistent_keepalive_interval=%d
preshared_key=%s
allowed_ip=0.0.0.0/0`, selfSK, peerPK, peerEndpoint, keepAlive, preSharedKey)
setting := &DeviceSetting{ ipcRequest: request, dns: dns, deviceAddr: &selfEndpoint }
setting := &DeviceSetting{ipcRequest: request, dns: dns, deviceAddr: &selfEndpoint}
return setting, nil
}
@ -264,7 +264,6 @@ func (c CredentialValidator) Valid(username, password string) bool {
return c.username == username && c.password == password
}
func connForward(bufSize int, from, to net.Conn) {
buf := make([]byte, bufSize)
for {
@ -347,7 +346,7 @@ func tcpServerRoutine(config map[string]string) (func(*netstack.Net), error) {
return nil, errors.New("listen port out of bound")
}
addr := &net.TCPAddr{Port : int(listenPort)}
addr := &net.TCPAddr{Port: int(listenPort)}
target, ok := config["target"]
if !ok {
@ -436,5 +435,5 @@ func main() {
go netRoutine(tnet)
}
select{} // sleep eternally
select {} // sleep eternally
}