]> Cypherpunks.ru repositories - govpn.git/blobdiff - src/govpn/cmd/govpn-client/udp.go
JSON configuration
[govpn.git] / src / govpn / cmd / govpn-client / udp.go
index b4398f327a0b69931fa87350e34be004b97a7719..9f45f8be51b68f8ccac1d2eb8dd41a832da9884b 100644 (file)
@@ -72,14 +72,12 @@ MainCycle:
                        }
                        if atomic.LoadInt64(&peer.BytesIn)+atomic.LoadInt64(&peer.BytesOut) > govpn.MaxBytesPerKey {
                                log.Println("Need rehandshake")
-                               terminator <- struct{}{}
-                               terminator = nil
                                rehandshaking <- struct{}{}
                                break MainCycle
                        }
                        continue
                }
-               if govpn.IDsCache.Find(buf[:n]) == nil {
+               if idsCache.Find(buf[:n]) == nil {
                        log.Println("Invalid identity in handshake packet")
                        continue
                }
@@ -120,4 +118,5 @@ MainCycle:
        if hs != nil {
                hs.Zero()
        }
+       conn.Close()
 }