From c80fc96be2028bbf93a9bfbd986aee7e15f92d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Tue, 17 Jan 2023 21:00:31 +0000 Subject: [PATCH] clat: enable PACKET_AUXDATA cmsg reception MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (this should effectively still be a no-op, as the socket is read() from in clatd, that will change in another commit) Bug: 259872525 Signed-off-by: Maciej Żenczykowski Change-Id: Ice6c0440a98219a54c51e9bd41f5bc77e4067d11 --- .../com_android_server_connectivity_ClatCoordinator.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/service/jni/com_android_server_connectivity_ClatCoordinator.cpp b/service/jni/com_android_server_connectivity_ClatCoordinator.cpp index 18d23111e2..9e46f08bda 100644 --- a/service/jni/com_android_server_connectivity_ClatCoordinator.cpp +++ b/service/jni/com_android_server_connectivity_ClatCoordinator.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -184,6 +185,12 @@ static jint com_android_server_connectivity_ClatCoordinator_openPacketSocket(JNI throwIOException(env, "packet socket failed", errno); return -1; } + int on = 1; + if (setsockopt(sock, SOL_PACKET, PACKET_AUXDATA, &on, sizeof(on))) { + throwIOException(env, "packet socket auxdata enablement failed", errno); + close(sock); + return -1; + } return sock; }