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

Jesse Gross jesse at nicira.com
Fri Oct 28 21:59:11 UTC 2011


On Fri, Oct 28, 2011 at 11:18 AM, Ben Pfaff <blp at nicira.com> wrote:
> On Thu, Oct 27, 2011 at 07:38:17PM -0700, Jesse Gross wrote:
>> 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.
>
> Oops, I meant to use the set-after-condition style throughout but I
> missed this one.
>
> Fixed:

Looks good.



More information about the dev mailing list