From 0d254ab06864250b9cd06948b87684361db11038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Thu, 13 Apr 2023 00:18:15 +0000 Subject: [PATCH] clat: make sure the tun device doesn't yet exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (fail with EBUSY if named device already exists) Bug: 277682237 Test: TreeHugger, ping 1.1.1.1 on v6 only wifi on bluejay Signed-off-by: Maciej Żenczykowski Change-Id: I71ed31e945ab80bda66637c31cddb869ab1ea750 --- service/jni/com_android_server_connectivity_ClatCoordinator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/jni/com_android_server_connectivity_ClatCoordinator.cpp b/service/jni/com_android_server_connectivity_ClatCoordinator.cpp index dbb12ee3ea..6078e280d3 100644 --- a/service/jni/com_android_server_connectivity_ClatCoordinator.cpp +++ b/service/jni/com_android_server_connectivity_ClatCoordinator.cpp @@ -233,7 +233,7 @@ static jint com_android_server_connectivity_ClatCoordinator_createTunInterface(J } struct ifreq ifr = { - .ifr_flags = IFF_TUN, + .ifr_flags = static_cast(IFF_TUN | IFF_TUN_EXCL), }; strlcpy(ifr.ifr_name, v4interface.c_str(), sizeof(ifr.ifr_name));