diff options
author | Jake McGinty <me@jake.su> | 2018-05-18 20:32:57 -0700 |
---|---|---|
committer | Jake McGinty <me@jake.su> | 2018-05-18 20:32:57 -0700 |
commit | f4572f96f95113e0591921bc4cb629474c6d7251 (patch) | |
tree | 33b9766ff1b84198f84b304b0f3b050411370e17 /src/peer.rs | |
parent | global: update serde (diff) | |
download | wireguard-rs-f4572f96f95113e0591921bc4cb629474c6d7251.tar.xz wireguard-rs-f4572f96f95113e0591921bc4cb629474c6d7251.zip |
cookies: implement cookie replies under load
Diffstat (limited to 'src/peer.rs')
-rw-r--r-- | src/peer.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/peer.rs b/src/peer.rs index 04d6a93..0208418 100644 --- a/src/peer.rs +++ b/src/peer.rs @@ -257,7 +257,7 @@ impl Peer { ensure!(len == 12, "incorrect handshake payload length"); let timestamp = timestamp.into(); - Ok(IncompleteIncomingHandshake { their_index: packet.their_index(), timestamp, noise }) + Ok(IncompleteIncomingHandshake { their_index: packet.sender_index(), timestamp, noise }) } /// Takes a new handshake packet (type 0x01), updates the internal peer state, @@ -323,7 +323,7 @@ impl Peer { let _ = session.noise.read_message(packet.noise_bytes(), &mut [])?; session = session.into_transport_mode()?; - session.their_index = packet.their_index(); + session.their_index = packet.sender_index(); session.birthday = Timestamp::now(); self.info.endpoint = Some(addr); |