aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/config.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-02-22 21:45:03 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2017-02-23 07:09:49 +0100
commitd4edc7baa8be10488b681fd329b2480ac6dc7f0e (patch)
treee0b1d0ebd8646753469f31d815a6ab44087ebf22 /src/config.c
parentwg-quick: allow config files without trailing newline (diff)
downloadwireguard-tools-d4edc7baa8be10488b681fd329b2480ac6dc7f0e.tar.xz
wireguard-tools-d4edc7baa8be10488b681fd329b2480ac6dc7f0e.zip
wg: give "off" value for fwmark
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index b3384da..b9a65c1 100644
--- a/src/config.c
+++ b/src/config.c
@@ -97,6 +97,12 @@ static inline bool parse_fwmark(uint32_t *fwmark, unsigned int *flags, const cha
char *end;
int base = 10;
+ if (!strcasecmp(value, "off")) {
+ *fwmark = 0;
+ *flags |= WGDEVICE_REMOVE_FWMARK;
+ return true;
+ }
+
if (value[0] == '0' && value[1] == 'x') {
value += 2;
base = 16;