diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-01-24 17:43:35 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-02-13 21:55:18 +0100 |
commit | 5a6d43eb15b537e525d724c9fb3400031ae14c70 (patch) | |
tree | 2824757f1016582eb74fc83bf06989b142cb627b /src/config.c | |
parent | main: add `wg` type alias (diff) | |
download | wireguard-monolithic-historical-5a6d43eb15b537e525d724c9fb3400031ae14c70.tar.xz wireguard-monolithic-historical-5a6d43eb15b537e525d724c9fb3400031ae14c70.zip |
socket: enable setting of fwmark
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c index 172287a..30c876e 100644 --- a/src/config.c +++ b/src/config.c @@ -125,6 +125,11 @@ int config_set_device(struct wireguard_device *wg, void __user *user_device) goto out; } + if (in_device.fwmark || (!in_device.fwmark && (in_device.flags & WGDEVICE_REMOVE_FWMARK))) { + wg->fwmark = in_device.fwmark; + peer_for_each_unlocked(wg, clear_peer_endpoint_src, NULL); + } + if (in_device.port) { ret = set_device_port(wg, in_device.port); if (ret) @@ -287,6 +292,7 @@ int config_get_device(struct wireguard_device *wg, void __user *udevice) } out_device.port = wg->incoming_port; + out_device.fwmark = wg->fwmark; strncpy(out_device.interface, dev->name, IFNAMSIZ - 1); out_device.interface[IFNAMSIZ - 1] = 0; |