diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2017-11-14 16:27:53 +0100 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2017-11-14 16:27:53 +0100 |
commit | 69fe86edf0ba371b9b0a54e522ec20d33e0ae129 (patch) | |
tree | d2787000c41a9790feb03f5d5dc40e124d10f697 /src/conn.go | |
parent | 566269275ed97812ec909b10ec77c7c037d9e2ea (diff) | |
download | wireguard-go-69fe86edf0ba371b9b0a54e522ec20d33e0ae129.tar.gz wireguard-go-69fe86edf0ba371b9b0a54e522ec20d33e0ae129.zip |
Initial working source caching
Diffstat (limited to 'src/conn.go')
-rw-r--r-- | src/conn.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/conn.go b/src/conn.go index 0347262..a047bb6 100644 --- a/src/conn.go +++ b/src/conn.go @@ -2,6 +2,8 @@ package main import ( "errors" + "golang.org/x/net/ipv4" + "golang.org/x/net/ipv6" "net" ) @@ -42,7 +44,6 @@ func unsafeCloseUDPListener(device *Device) error { if netc.bind != nil { err = netc.bind.Close() netc.bind = nil - netc.update.Add(1) } return err } @@ -68,6 +69,8 @@ func UpdateUDPListener(device *Device) error { if device.tun.isUp.Get() { + device.log.Debug.Println("UDP bind updating") + // bind to new port var err error @@ -94,8 +97,10 @@ func UpdateUDPListener(device *Device) error { // decrease waitgroup to 0 + go device.RoutineReceiveIncomming(ipv4.Version, netc.bind) + go device.RoutineReceiveIncomming(ipv6.Version, netc.bind) + device.log.Debug.Println("UDP bind has been updated") - netc.update.Done() } return nil |