Add localnet ports to their corresponding southbound multicast group.

Update unit tests.

Reported-at: https://github.com/ovn-org/ovn/issues/125
Reported-by: Diko Parvanov <m...@dparv.dev>
Suggested-by: Dumitru Ceara <dce...@redhat.com>
Signed-off-by: Alin-Gabriel Serdean <aserd...@ovn.org>
---
 northd/northd.c | 17 ++++++++++-------
 tests/ovn.at    | 15 ++-------------
 2 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/northd/northd.c b/northd/northd.c
index a56666297..4441ef631 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -4591,13 +4591,6 @@ ovn_igmp_group_aggregate_ports(struct ovn_igmp_group 
*igmp_group,
         ovn_igmp_group_destroy_entry(entry);
         free(entry);
     }
-
-    if (igmp_group->datapath->n_localnet_ports) {
-        ovn_multicast_add_ports(mcast_groups, igmp_group->datapath,
-                                &igmp_group->mcgroup,
-                                igmp_group->datapath->localnet_ports,
-                                igmp_group->datapath->n_localnet_ports);
-    }
 }
 
 static void
@@ -15066,6 +15059,16 @@ build_mcast_groups(struct lflow_input *input_data,
 
         /* Add the extracted ports to the IGMP group. */
         ovn_igmp_group_add_entry(igmp_group, igmp_ports, n_igmp_ports);
+        if (!ovn_igmp_group_allocate_id(igmp_group)) {
+            ovn_igmp_group_destroy(igmp_groups, igmp_group);
+            continue;
+        }
+        if (igmp_group->datapath->n_localnet_ports) {
+            ovn_multicast_add_ports(mcast_groups, igmp_group->datapath,
+                                    &igmp_group->mcgroup,
+                                    igmp_group->datapath->localnet_ports,
+                                    igmp_group->datapath->n_localnet_ports);
+        }
     }
 
     /* Build IGMP groups for multicast routers with relay enabled. The router
diff --git a/tests/ovn.at b/tests/ovn.at
index 34b6abfc0..5440639a8 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -19570,7 +19570,8 @@ ovn-nbctl lsp-add sw3 sw3-p1
 ovn-nbctl lsp-add sw3 sw3-p2
 ovn-nbctl lsp-add sw3 sw3-ln                    \
     -- lsp-set-type sw3-ln localnet             \
-    -- lsp-set-options sw3-ln network_name=phys
+    -- lsp-set-options sw3-ln network_name=phys \
+    -- lsp-set-options sw3-ln mcast_flood=true
 
 ovn-nbctl lr-add rtr
 ovn-nbctl lrp-add rtr rtr-sw1 00:00:00:00:01:00 10.0.0.254/24
@@ -19985,18 +19986,6 @@ store_ip_multicast_pkt \
     $(ip_to_hex 10 0 0 42) $(ip_to_hex 239 0 1 68) 1e 20 ca70 11 \
     e518e518000a3b3a0000 expected_switched
 
-# TODO: IGMP Relay duplicates IP multicast packets in some conditions, for
-# more details see TODO.rst, section "IP Multicast Relay". Once that issue is
-# fixed the duplicated packets should not appear anymore.
-store_ip_multicast_pkt \
-    000000000100 01005e000144 \
-    $(ip_to_hex 10 0 0 42) $(ip_to_hex 239 0 1 68) 1e 1f cb70 11 \
-    e518e518000a3b3a0000 expected_routed_sw1
-store_ip_multicast_pkt \
-    000000000200 01005e000144 \
-    $(ip_to_hex 10 0 0 42) $(ip_to_hex 239 0 1 68) 1e 1f cb70 11 \
-    e518e518000a3b3a0000 expected_routed_sw2
-
 OVS_WAIT_UNTIL(
   [check_packets 'hv1/vif1-tx.pcap expected_routed_sw1' \
                  'hv2/vif3-tx.pcap expected_routed_sw2' \
-- 
2.32.0

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to