From fc4dd3ef455975a033714052b12ebebc85e937d5 Mon Sep 17 00:00:00 2001 From: Ghanan Gowripalan Date: Thu, 6 Aug 2020 01:29:32 -0700 Subject: Join IPv4 all-systems group on NIC enable Test: - stack_test.TestJoinLeaveMulticastOnNICEnableDisable - integration_test.TestIncomingMulticastAndBroadcast PiperOrigin-RevId: 325185259 --- .../tests/integration/multicast_broadcast_test.go | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'pkg/tcpip/tests') diff --git a/pkg/tcpip/tests/integration/multicast_broadcast_test.go b/pkg/tcpip/tests/integration/multicast_broadcast_test.go index 4a860a805..d9b2d147a 100644 --- a/pkg/tcpip/tests/integration/multicast_broadcast_test.go +++ b/pkg/tcpip/tests/integration/multicast_broadcast_test.go @@ -31,7 +31,9 @@ import ( const defaultMTU = 1280 -func TestIncomingSubnetBroadcast(t *testing.T) { +// TestIncomingMulticastAndBroadcast tests receiving a packet destined to some +// multicast or broadcast address. +func TestIncomingMulticastAndBroadcast(t *testing.T) { const ( nicID = 1 remotePort = 5555 @@ -179,6 +181,24 @@ func TestIncomingSubnetBroadcast(t *testing.T) { expectRx: true, }, + { + name: "IPv4 all-systems multicast binding to all-systems multicast", + bindAddr: header.IPv4AllSystems, + dstAddr: header.IPv4AllSystems, + expectRx: true, + }, + { + name: "IPv4 all-systems multicast binding to wildcard", + dstAddr: header.IPv4AllSystems, + expectRx: true, + }, + { + name: "IPv4 all-systems multicast binding to unicast", + bindAddr: ipv4Addr.Address, + dstAddr: header.IPv4AllSystems, + expectRx: false, + }, + // IPv6 has no notion of a broadcast. { name: "IPv6 unicast binding to wildcard", -- cgit v1.2.3