]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commitdiff
wg-quick: android: use iproute2 to bring up interface instead of ndc
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 25 Aug 2020 19:54:22 +0000 (21:54 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 25 Aug 2020 19:54:22 +0000 (21:54 +0200)
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 <me@msfjarvis.dev>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
src/wg-quick/android.c

index 49ae1e34c397b978eabdc0a45978cc3510e64b84..2ad107eb1fb60157e2fc935cbfabdae16fed9070 100644 (file)
@@ -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);
 }