diff mbox series

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

Message ID 1524263318-12201-1-git-send-email-ashishvarma.ovs@gmail.com
State Accepted
Headers show
Series [ovs-dev,v3] ovs-ofctl: Fixed the "snoop" command of ovs-ofctl | expand

Commit Message

Ashish Varma April 20, 2018, 10:28 p.m. UTC
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@gmail.com>
---
v2-v3

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(+)

Comments

Ben Pfaff April 25, 2018, 7:47 p.m. UTC | #1
On Fri, Apr 20, 2018 at 03:28:38PM -0700, Ashish Varma wrote:
> 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@gmail.com>
> ---
> v2-v3
> 
> Updated the comment in the code to explain why 'use_names' is set to 0
> for snoop command.

Thanks, I applied this to master.  I updated the style of the comment to
match our usual coding style requirements.

Thanks,

Ben.
diff mbox series

Patch

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);
 }