aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/device.h
diff options
context:
space:
mode:
authorJulian Orth <ju.orth@gmail.com>2018-09-06 20:48:03 +0200
committerJulian Orth <ju.orth@gmail.com>2018-12-15 17:19:05 +0100
commitd82ea502b971fdc75cd500973546a164d3302828 (patch)
tree4e6719c7d93ca1013f7e58ee480ef36d9ed8b1bf /src/device.h
parentdevice: rename creating_net to transit_net (diff)
downloadwireguard-monolithic-historical-d82ea502b971fdc75cd500973546a164d3302828.tar.xz
wireguard-monolithic-historical-d82ea502b971fdc75cd500973546a164d3302828.zip
device: store a copy of the device net
This eliminates the need for have_transit_net_ref because have_transit_net_ref == true if and only if dev_net != transit_net.
Diffstat (limited to 'src/device.h')
-rw-r--r--src/device.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/device.h b/src/device.h
index be54d4a..e1d4e84 100644
--- a/src/device.h
+++ b/src/device.h
@@ -41,6 +41,7 @@ struct wg_device {
struct crypt_queue encrypt_queue, decrypt_queue;
struct sock __rcu *sock4, *sock6;
struct net *transit_net;
+ struct net *dev_net;
struct noise_static_identity static_identity;
struct workqueue_struct *handshake_receive_wq, *handshake_send_wq;
struct workqueue_struct *packet_crypt_wq;
@@ -56,10 +57,11 @@ struct wg_device {
unsigned int num_peers, device_update_gen;
u32 fwmark;
u16 incoming_port;
- bool have_transit_net_ref;
};
int wg_device_init(void);
void wg_device_uninit(void);
+void wg_device_set_nets(struct wg_device *wg, struct net *dev_net,
+ struct net *transit_net);
#endif /* _WG_DEVICE_H */