From 3ba0247634bbaa1da61532ca43e67fb2ad6c1106 Mon Sep 17 00:00:00 2001 From: Mathias Hall-Andersen Date: Mon, 18 Nov 2019 13:13:55 +0100 Subject: Better compartmentalization of cryptokey router --- src/wireguard/router/device.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/wireguard/router/device.rs') diff --git a/src/wireguard/router/device.rs b/src/wireguard/router/device.rs index 04b2045..7adcf8a 100644 --- a/src/wireguard/router/device.rs +++ b/src/wireguard/router/device.rs @@ -22,7 +22,7 @@ use super::types::{Callbacks, RouterError}; use super::workers::{worker_parallel, JobParallel}; use super::SIZE_MESSAGE_PREFIX; -use super::route::get_route; +use super::route::RoutingTable; use super::super::{bind, tun, Endpoint, KeyPair}; @@ -35,8 +35,7 @@ pub struct DeviceInner>>>, // receiver id -> decryption state - pub ipv4: RwLock>>>, // ipv4 cryptkey routing - pub ipv6: RwLock>>>, // ipv6 cryptkey routing + pub table: RoutingTable>, // work queues pub queue_next: AtomicUsize, // next round-robin index @@ -95,8 +94,7 @@ impl> Device> Device