Before creating an mirror port, it is necessary to first check whether the original port exists. Otherwise, when the original port does not exist, the created mirror port will remain.
Signed-off-by: yangchang <[email protected]> --- utilities/ovs-tcpdump.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utilities/ovs-tcpdump.in b/utilities/ovs-tcpdump.in index a49ec9f..fb2f9b2 100755 --- a/utilities/ovs-tcpdump.in +++ b/utilities/ovs-tcpdump.in @@ -487,6 +487,9 @@ def main(): print("TCPDUMP Args: %s" % ' '.join(tcpdargs)) ovsdb = OVSDB(db_sock) + if not ovsdb.port_exists(interface): + print("ERROR: Port %s does not exist." % interface) + sys.exit(1) if mirror_interface is None: mirror_interface = "mi%s" % interface if sys.platform in _make_mirror_name: @@ -508,9 +511,6 @@ def main(): (mirror_interface, mirror_interface + "2")) sys.exit(1) - if not ovsdb.port_exists(interface): - print("ERROR: Port %s does not exist." % interface) - sys.exit(1) if ovsdb.port_exists(mirror_interface): print("ERROR: Mirror port (%s) exists for port %s." % (mirror_interface, interface)) -- 1.8.3.1 [email protected] _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
