From 9a0d65e2afbd6e418c883e0de8555b4fac29f1d5 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 25 Aug 2020 21:54:22 +0200 Subject: [PATCH] wg-quick: android: use iproute2 to bring up interface instead of ndc Android 11's ndc regresses even more, but it turns out that netd doesn't need to track up/down state via direct invocation, so just set the interface up by way of normal iproute2. Reported-by: Harsh Shandilya Signed-off-by: Jason A. Donenfeld --- src/wg-quick/android.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wg-quick/android.c b/src/wg-quick/android.c index 49ae1e3..2ad107e 100644 --- a/src/wg-quick/android.c +++ b/src/wg-quick/android.c @@ -726,7 +726,7 @@ static void up_if(unsigned int *netid, const char *iface, uint16_t listen_port) cmd("iptables -I INPUT 1 -p udp --dport %u -j ACCEPT -m comment --comment \"wireguard rule %s\"", listen_port, iface); cmd("ip6tables -I INPUT 1 -p udp --dport %u -j %s -m comment --comment \"wireguard rule %s\"", listen_port, should_block_ipv6(iface) ? "DROP" : "ACCEPT", iface); } - cndc("interface setcfg %s up", iface); + cmd("ip link set up dev %s", iface); cndc("network create %u vpn 1 1", *netid); cndc("network interface add %u %s", *netid, iface); }