[ovs-dev] [PATCH v3] ovs-ofctl: Fixed the "snoop" command of ovs-ofctl

Ashish Varma ashishvarma.ovs at gmail.com
Fri Apr 20 22:28:38 UTC 2018

In case where "use_names" is set (e.g. in an interactive session) to show
the port and table names when ovs-ofctl is run with snoop command,
ovs-ofctl would get stuck in an endless loop inside "table_iterator_next"
function's while loop checking for "while (ti->send_xid != recv_xid)".
This would happening because the "vconn" to "<bridge>.snoop" socket would
not respond to TABLE_FEATURES_REQUEST sent by ovs-ofctl.

This commit disables showing port or table names in the snoop command.

Signed-off-by: Ashish Varma <ashishvarma.ovs at gmail.com>

Updated the comment in the code to explain why 'use_names' is set to 0
for snoop command.
 utilities/ovs-ofctl.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index 6708b07..92a5ebc 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -2326,6 +2326,11 @@ ofctl_snoop(struct ovs_cmdl_context *ctx)
     struct vconn *vconn;
+    /* we can't use the snoop vconn to send table features request or
+     * port description request messages to show names. ovs-vswitchd
+     * will not respond to these messages on snoop vconn */
+    use_names = 0;
     open_vconn__(ctx->argv[1], SNOOP, &vconn);
     monitor_vconn(vconn, false, false);

More information about the dev mailing list