summaryrefslogtreecommitdiffhomepage
path: root/src/peer.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-11-10 23:28:35 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-11-15 02:42:36 +0100
commit032d0526c9b52d1391fc14fa532ef5162e4c1822 (patch)
tree0b93b6b25bdfc10632e4c6c4d065c659eb623106 /src/peer.h
parent450e45d9570450e6a10323902e4198c30cd312a0 (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.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/peer.h b/src/peer.h
index 895eb77..07c4d16 100644
--- a/src/peer.h
+++ b/src/peer.h
@@ -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;