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

Ashish Varma ashishvarma.ovs at gmail.com
Wed Apr 18 01:40:46 UTC 2018

In normal ovs-ofctl commands (e.g. add-flow), ovs-ofctl connects to
ovs-vswitchd process on “<ovs_rundir()>/<bridge_name>.mgmt” unix socket.
In an output that contains a port or table, port name or table name can be
displayed, instead of their numbers, if the user turns on this feature.
(by -—names option) Also, this feature is enabled when interacting with a user
on console.  To fetch the names, ovs-ofctl sends TABLE FEATURE /
PORT DESCRIPTION request message to ovs-vswitchd process and expects a reply
on the connection.
When ovs-ofctl runs the snoop command, it connects to
“<ovs_rundir()>/<bridge_name>.snoop” unix socket. ovs-vswitchd process would
not reply to the TABLE FEATURE / PORT DESCRIPTION request message on this
connection. It would only send any open flow message it receives from the
When using port/table name feature with snoop command, the print of open flow
message would call ‘tables_to_show()’/‘ports_to_show()’ which in turn would
send the request message on the snoop connection. ovs-vswitchd would not reply
back on this connection, but instead would keep sending the open flow messages
received from controller. ‘table_iterator_next()/port_iterator_next()’ function
would loop for ever waiting for response.
The fix for this is to turn off display of table/port names when running
snoop command.

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

Added more description to the cause of the issue and reason to add the fix.
 utilities/ovs-ofctl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index 6708b07..3023787 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -2326,6 +2326,7 @@ ofctl_snoop(struct ovs_cmdl_context *ctx)
     struct vconn *vconn;
+    use_names = 0; /* don't show port and table names */
     open_vconn__(ctx->argv[1], SNOOP, &vconn);
     monitor_vconn(vconn, false, false);

More information about the dev mailing list