From 31c6fcd7d928dfeadd89eb8c30e4045ae68083be Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 7 Mar 2012 13:52:55 -0800 Subject: [PATCH] ovs-ofctl: Avoid segfault upon receive error for "monitor", "snoop". Bug #10062. Reported-by: James Schmidt Signed-off-by: Ben Pfaff --- utilities/ovs-ofctl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index fd0829ea..607ec256 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -1004,9 +1004,8 @@ monitor_vconn(struct vconn *vconn) if (retval == EAGAIN) { break; } - msg_type = ((const struct ofp_header *) b->data)->type; - run(retval, "vconn_recv"); + if (timestamp) { time_t now = time_wall(); char s[32]; @@ -1014,6 +1013,8 @@ monitor_vconn(struct vconn *vconn) strftime(s, sizeof s, "%Y-%m-%d %H:%M:%S: ", localtime(&now)); fputs(s, stderr); } + + msg_type = ((const struct ofp_header *) b->data)->type; ofp_print(stderr, b->data, b->size, verbosity + 2); ofpbuf_delete(b); -- 2.30.2