[ovs-dev] [PATCH] ovs-ofctl: Avoid segfault upon receive error for "monitor", "snoop".

Ethan Jackson ethan at nicira.com
Wed Mar 7 13:58:09 PST 2012


Looks good, thanks.

Ethan

On Wed, Mar 7, 2012 at 13:53, Ben Pfaff <blp at nicira.com> wrote:
> Bug #10062.
> Reported-by: James Schmidt <jschmidt at nicira.com>
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
>  utilities/ovs-ofctl.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
> index fd0829e..607ec25 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);
>
> --
> 1.7.2.5
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list