Merge "Add IFF_MULTICAST to test interfaces" am: aa5532cb6f am: e90ceefb34

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1856105

Change-Id: Id88dd9ea20c6a099e7f06f64f768fe04d22169b5
This commit is contained in:
Treehugger Robot
2021-11-05 20:35:33 +00:00
committed by Automerger Merge Worker

View File

@@ -66,6 +66,8 @@ static int createTunTapInterface(JNIEnv* env, bool isTun, const char* iface) {
// Activate interface using an unconnected datagram socket.
base::unique_fd inet6CtrlSock(socket(AF_INET6, SOCK_DGRAM, 0));
ifr.ifr_flags = IFF_UP;
// Mark TAP interfaces as supporting multicast
if (!isTun) ifr.ifr_flags |= IFF_MULTICAST;
if (ioctl(inet6CtrlSock.get(), SIOCSIFFLAGS, &ifr)) {
throwException(env, errno, "activating", ifr.ifr_name);