]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commit
wg-quick: use addconf instead of setconf master
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 19 Jun 2025 14:58:39 +0000 (16:58 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Thu, 19 Jun 2025 15:08:50 +0000 (17:08 +0200)
commit0b7d9821f2815973a2930ace28a3f73c205d0e5c
treea303913e99e623346e458199bf00b1bf97719221
parentd3b40aff964789a2a0533cb7a070592a75a996e3
wg-quick: use addconf instead of setconf

The example in the man page at some point changed:

-    \fBPostUp = wg set %i private-key <(pass WireGuard/private-keys/%i)\fP
+    \fBPreUp = wg set %i private-key <(pass WireGuard/private-keys/%i)\fP

This is actually wrong because PreUp is followed by set_config(), which
calls `wg setconf`, which in turn deletes the private key from the
interface because it is missing from the configuration. Replacing this
with `wg addconf` is safe to do because the interface is newly created.

Suggested-by: Matthias Dressel <code@deadcode.eu>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
src/wg-quick/android.c
src/wg-quick/darwin.bash
src/wg-quick/freebsd.bash
src/wg-quick/linux.bash
src/wg-quick/openbsd.bash