Added ForceSendHandshakeInitiation

This commit is contained in:
Ludvig Strigeus 2018-11-20 20:36:08 +01:00
parent e08a078588
commit 936f61d05b
2 changed files with 9 additions and 0 deletions

View file

@ -621,6 +621,12 @@ void WireguardProcessor::RunAllMainThreadScheduled() {
}
}
void WireguardProcessor::ForceSendHandshakeInitiation(WgPeer *peer) {
peer->last_handshake_init_timestamp_ -= REKEY_TIMEOUT_MS;
peer->total_handshake_attempts_ = 0;
SendHandshakeInitiation(peer);
}
void WireguardProcessor::SendHandshakeInitiation(WgPeer *peer) {
assert(dev_.IsMainThread());

View file

@ -111,6 +111,9 @@ public:
TunInterface::PrePostCommands &prepost() { return pre_post_; }
const std::vector<WgCidrAddr> &addr() { return addresses_; }
void RunAllMainThreadScheduled();
void ForceSendHandshakeInitiation(WgPeer *peer);
private:
void DoWriteUdpPacket(Packet *packet);
void WriteAndEncryptPacketToUdp_WillUnlock(WgPeer *peer, Packet *packet);