Clean dependencies and imports

This commit is contained in:
Mathias Hall-Andersen
2019-11-21 11:43:16 +01:00
parent 3ba0247634
commit 92dbb4c46a
11 changed files with 59 additions and 65 deletions

View File

@@ -368,7 +368,6 @@ impl<T: Tun, B: Bind> Wireguard<T, B> {
wg.pending.fetch_sub(1, Ordering::SeqCst);
let device = wg.handshake.read();
match job {
HandshakeJob::Message(msg, src) => {
// feed message to handshake device
@@ -418,10 +417,14 @@ impl<T: Tun, B: Bind> Wireguard<T, B> {
// update endpoint
peer.router.set_endpoint(src);
// update timers after sending handshake response
if resp_len > 0 {
// update timers after sending handshake response
debug!("{} : handshake worker, handshake response sent", wg);
peer.state.sent_handshake_response();
} else {
// update timers after receiving handshake response
debug!("{} : handshake worker, handshake response was received", wg);
peer.state.timers_handshake_complete();
}
// add any new keypair to peer