[ovs-dev] [PATCH] datapath: Make port numbers for UDP-based tunnels userspace configurable.

Jesse Gross jesse at nicira.com
Thu Oct 27 19:38:17 PDT 2011


On Wed, Oct 26, 2011 at 3:27 PM, Ben Pfaff <blp at nicira.com> wrote:
> diff --git a/datapath/tunnel.c b/datapath/tunnel.c
> index 372d90e..047961f 100644
> --- a/datapath/tunnel.c
> +++ b/datapath/tunnel.c
> @@ -1347,29 +1438,57 @@ static int tnl_set_config(struct nlattr *options, const struct tnl_ops *tnl_ops,
>        struct nlattr *a[OVS_TUNNEL_ATTR_MAX + 1];
>        int err;
>
> +       err = -EINVAL;
>        if (!options)
> -               return -EINVAL;
> +               goto error;

One other small thing: I found this style of error handling (where the
error is assigned before the condition) to be prone to problems when
code is moved around and the error is no longer properly initialized.



More information about the dev mailing list