aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/wg-quick/android.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2025-06-19 16:58:39 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2025-06-19 17:08:50 +0200
commit0b7d9821f2815973a2930ace28a3f73c205d0e5c (patch)
treea303913e99e623346e458199bf00b1bf97719221 /src/wg-quick/android.c
parentwg-quick: linux: deal with resolvconf migration more gracefully (diff)
downloadwireguard-tools-master.tar.xz
wireguard-tools-master.zip
wg-quick: use addconf instead of setconfHEADmaster
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>
Diffstat (limited to 'src/wg-quick/android.c')
-rw-r--r--src/wg-quick/android.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wg-quick/android.c b/src/wg-quick/android.c
index 1263ee4..3ed05e5 100644
--- a/src/wg-quick/android.c
+++ b/src/wg-quick/android.c
@@ -1047,7 +1047,7 @@ static void set_routes(const char *iface, unsigned int netid)
static void set_config(const char *iface, const char *config)
{
FILE *config_writer;
- _cleanup_free_ char *cmd = concat("wg setconf ", iface, " /proc/self/fd/0", NULL);
+ _cleanup_free_ char *cmd = concat("wg addconf ", iface, " /proc/self/fd/0", NULL);
int ret;
printf("[#] %s\n", cmd);