]> git.proxmox.com Git - mirror_ovs.git/commitdiff
ofproto-dpif-xlate: Prevent duplicating of traffic to a mirror port
authorDmytro Linkin <dmitrolin@mellanox.com>
Tue, 3 Dec 2019 14:11:21 +0000 (16:11 +0200)
committerBen Pfaff <blp@ovn.org>
Tue, 3 Dec 2019 18:31:54 +0000 (10:31 -0800)
Currently ofproto design disallow duplicating output packet on forwarding
and mirroring to/from same ovs port. Next scenario reveal lack of design:
1. Send ping between regular ovs ports (VFs, for ex.), stop it.
2. While rule still exist, make mirror for one of the ports.
Prevent duplicating of traffic to a mirror port.

Fixes: 86e2dcddce85 ("dpif-xlate: Snoop multicast packets and send them properly")
Signed-off-by: Dmytro Linkin <dmitrolin@mellanox.com>
Acked-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
ofproto/ofproto-dpif-xlate.c

index 7e55575b183afe16dfede6da8534f3cf98445f3d..daf7fec80c9efff829a31a0b6732534d5267e9a0 100644 (file)
@@ -3118,6 +3118,13 @@ xlate_normal(struct xlate_ctx *ctx)
 
         if (mac_port) {
             struct xbundle *mac_xbundle = xbundle_lookup(ctx->xcfg, mac_port);
+
+            if (mac_xbundle && xbundle_mirror_out(ctx->xbridge, mac_xbundle)) {
+                xlate_report(ctx, OFT_WARN,
+                             "learned port is a mirror port, dropping");
+                return;
+            }
+
             if (mac_xbundle
                 && mac_xbundle != in_xbundle
                 && mac_xbundle->ofbundle != in_xbundle->ofbundle) {