diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-11-10 23:28:35 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-11-15 02:42:36 +0100 |
commit | 032d0526c9b52d1391fc14fa532ef5162e4c1822 (patch) | |
tree | 0b93b6b25bdfc10632e4c6c4d065c659eb623106 /src/peer.h | |
parent | 450e45d9570450e6a10323902e4198c30cd312a0 (diff) |
socket: keep track of src address in sending packets
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/peer.h')
-rw-r--r-- | src/peer.h | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -16,9 +16,21 @@ struct wireguard_device; +struct endpoint { + union { + struct sockaddr_storage addr_storage; + struct sockaddr_in addr4; + struct sockaddr_in6 addr6; + }; + union { + struct in_addr src4; + struct in6_addr src6; + }; +}; + struct wireguard_peer { struct wireguard_device *device; - struct sockaddr_storage endpoint_addr; + struct endpoint endpoint; struct dst_cache endpoint_cache; rwlock_t endpoint_lock; struct noise_handshake handshake; |