Merge "Allow mDNS on IFF_POINTOPOINT interfaces" into main

This commit is contained in:
Patrick Rohr 2025-02-24 19:09:47 -08:00 • committed by Gerrit Code Review
commit 81e6bdccd3
2 changed files with 1 additions and 13 deletions

View file

@ -564,7 +564,6 @@ public class MdnsSocketProvider {
// Never try mDNS on cellular, or on interfaces with incompatible flags
if (CollectionUtils.contains(transports, TRANSPORT_CELLULAR)
|| iface.isLoopback()
|| iface.isPointToPoint()
|| iface.isVirtual()
|| !iface.isUp()) {
return false;

View file

@ -610,6 +610,7 @@ public class MdnsSocketProviderTest {
@Test
public void testSocketCreatedForMulticastInterface() throws Exception {
doReturn(true).when(mTestNetworkIfaceWrapper).isPointToPoint();
doReturn(true).when(mTestNetworkIfaceWrapper).supportsMulticast();
startMonitoringSockets();
@ -620,18 +621,6 @@ public class MdnsSocketProviderTest {
testCallback.expectedSocketCreatedForNetwork(TEST_NETWORK, List.of(LINKADDRV4));
}
@Test
public void testNoSocketCreatedForPTPInterface() throws Exception {
doReturn(true).when(mTestNetworkIfaceWrapper).isPointToPoint();
startMonitoringSockets();
final TestSocketCallback testCallback = new TestSocketCallback();
runOnHandler(() -> mSocketProvider.requestSocket(TEST_NETWORK, testCallback));
postNetworkAvailable(TRANSPORT_BLUETOOTH);
testCallback.expectedNoCallback();
}
@Test
public void testNoSocketCreatedForVPNInterface() throws Exception {
// VPN interfaces generally also have IFF_POINTOPOINT, but even if they don't, they should