/*
GoVPN -- simple secure free software virtual private network daemon
-Copyright (C) 2014-2015 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2014-2016 Sergey Matveev <stargrave@stargrave.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
log.Println("Connected to UDP:" + *remoteAddr)
hs := govpn.HandshakeStart(*remoteAddr, conn, conf)
- buf := make([]byte, govpn.MTU)
+ buf := make([]byte, *mtu*2)
var n int
var timeouts int
var peer *govpn.Peer
}
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
}
if hs != nil {
hs.Zero()
}
+ conn.Close()
}