summaryrefslogtreecommitdiff
path: root/utilities
diff options
context:
space:
mode:
authorHan Ding <handing@chinatelecom.cn>2022-05-20 17:54:42 +0800
committerIlya Maximets <i.maximets@ovn.org>2022-06-07 15:08:33 +0200
commitc0d7d630be963b66bf6534d9ea16bc5845dc2521 (patch)
tree479e7a351f4a486881130ce0efdb4fe1995f10e5 /utilities
parent165f5fbb5e0ba034b9eac6812feb7cf41bd08c7f (diff)
downloadopenvswitch-c0d7d630be963b66bf6534d9ea16bc5845dc2521.tar.gz
ovs-tcpdump: Fix error when stopping ovs-tcpdump.
Sometimes we need to dump packets on more than two interfaces in a bridge at the same time. Then when we stop dumping in order, ovs-tcpdump print traceback and fail to delete mirror interface for some interface. For example: br-int has two interface tap1 and br-int. We use ovs-tcpdump dump tap1 first and dump br-int next. Then stopping tap1 ovs-tcpdump first, and stopping br-int second. When we stop ovs-tcpdump for br-int, the screen show the error like this: __main__.OVSDBException: Unable to delete Mirror m_br-int Signed-off-by: Han Ding <handing@chinatelecom.cn> Acked-by: Mike Pattrick <mkp@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'utilities')
-rwxr-xr-xutilities/ovs-tcpdump.in6
1 files changed, 6 insertions, 0 deletions
diff --git a/utilities/ovs-tcpdump.in b/utilities/ovs-tcpdump.in
index 82d1bedfa..b3dc65440 100755
--- a/utilities/ovs-tcpdump.in
+++ b/utilities/ovs-tcpdump.in
@@ -165,6 +165,9 @@ class OVSDB(object):
self._idl_conn = idl.Idl(db_sock, schema)
OVSDB.wait_for_db_change(self._idl_conn) # Initial Sync with DB
+ def close_idl(self):
+ self._idl_conn.close()
+
def _get_schema(self):
error, strm = Stream.open_block(Stream.open(self._db_sock))
if error:
@@ -500,6 +503,8 @@ def main():
pass
sys.exit(1)
+ ovsdb.close_idl()
+
pipes = _doexec(*([dump_cmd, '-i', mirror_interface] + tcpdargs))
try:
while pipes.poll() is None:
@@ -512,6 +517,7 @@ def main():
if pipes.poll() is None:
pipes.terminate()
+ ovsdb = OVSDB(db_sock)
ovsdb.destroy_mirror(interface, ovsdb.port_bridge(interface))
ovsdb.destroy_port(mirror_interface, ovsdb.port_bridge(interface))
if tap_created is True: