diff options
author | lic121 <lic121@chinatelecom.cn> | 2022-04-29 07:32:44 +0000 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2022-05-04 21:43:34 +0200 |
commit | 2236212ce1e17aa744aec1afdbbf99a98a43d61d (patch) | |
tree | f320d1533de16c828e93d48d1ce7d3f19d730abd | |
parent | 27df8dc13f6e6a3b3ee48810c93a5193eb44a708 (diff) | |
download | openvswitch-2236212ce1e17aa744aec1afdbbf99a98a43d61d.tar.gz |
ofproto-dpif-xlate: Remove mirror assert.
During the revalidation/upcall, mirror could be removed. Instead of crash
the process, we can simply skip the deleted mirror.
The issue had been triggered multiple times by ovs-tcpdump in my test.
Fixes: ec7ceaed4f3e ("ofproto-dpif: Modularize mirror code.")
Signed-off-by: lic121 <lic121@chinatelecom.cn>
Tested-by: Adrian Moreno <amorenoz@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rw-r--r-- | ofproto/ofproto-dpif-xlate.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index bd9abb21b..f2a47fc69 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -2135,9 +2135,14 @@ mirror_packet(struct xlate_ctx *ctx, struct xbundle *xbundle, int snaplen; /* Get the details of the mirror represented by the rightmost 1-bit. */ - ovs_assert(mirror_get(xbridge->mbridge, raw_ctz(mirrors), - &vlans, &dup_mirrors, - &out, &snaplen, &out_vlan)); + if (OVS_UNLIKELY(!mirror_get(xbridge->mbridge, raw_ctz(mirrors), + &vlans, &dup_mirrors, + &out, &snaplen, &out_vlan))) { + /* The mirror got reconfigured before we got to read it's + * configuration. */ + mirrors = zero_rightmost_1bit(mirrors); + continue; + } /* If this mirror selects on the basis of VLAN, and it does not select |