]> Cypherpunks.ru repositories - govpn.git/blobdiff - src/cypherpunks.ru/govpn/cmd/govpn-client/udp.go
Merge branch 'develop'
[govpn.git] / src / cypherpunks.ru / govpn / cmd / govpn-client / udp.go
index 3d0c421bd4168683ade366abf0bc54302affc2a7..acacbd15473b435abbada466ec37f8030e66ff85 100644 (file)
@@ -70,7 +70,7 @@ MainCycle:
                                log.Println("Unauthenticated packet")
                                timeouts++
                        }
-                       if atomic.LoadInt64(&peer.BytesIn)+atomic.LoadInt64(&peer.BytesOut) > govpn.MaxBytesPerKey {
+                       if atomic.LoadUint64(&peer.BytesIn)+atomic.LoadUint64(&peer.BytesOut) > govpn.MaxBytesPerKey {
                                log.Println("Need rehandshake")
                                rehandshaking <- struct{}{}
                                break MainCycle
@@ -89,7 +89,7 @@ MainCycle:
                log.Println("Handshake completed")
                knownPeers = govpn.KnownPeers(map[string]**govpn.Peer{*remoteAddr: &peer})
                if firstUpCall {
-                       go govpn.ScriptCall(*upPath, *ifaceName)
+                       go govpn.ScriptCall(*upPath, *ifaceName, *remoteAddr)
                        firstUpCall = false
                }
                hs.Zero()