[ovs-dev] [PATCH v2 2/4] ovn: Allow ct_lb actions to take IPv6 address arguments.

Mark Michelson mmichels at redhat.com
Thu Nov 2 14:57:00 UTC 2017


On Wed, Nov 1, 2017 at 4:53 PM Ben Pfaff <blp at ovn.org> wrote:

> On Tue, Oct 31, 2017 at 09:27:02AM -0500, Mark Michelson wrote:
> > The ct_lb action previously assumed that any address arguments were
> > IPv4. This patch expands the parsing, formatting, and encoding of ct_lb
> > to be amenable to IPv6 addresses as well.
> >
> > Signed-off-by: Mark Michelson <mmichels at redhat.com>
>
> Thanks for working on this.
>
> With this change, I get the following warning from Clang 3.8:
>
>     ../ovn/lib/actions.c:939:32: error: variable 'dst' is used
> uninitialized whenever 'if' condition is false
> [-Werror,-Wsometimes-uninitialized]
>     ../ovn/lib/actions.c:953:30: note: uninitialized use occurs here
>     ../ovn/lib/actions.c:939:28: note: remove the 'if' if its condition is
> always true
>     ../ovn/lib/actions.c:932:21: error: variable 'dst' is used
> uninitialized whenever 'if' condition is false
> [-Werror,-Wsometimes-uninitialized]
>     ../ovn/lib/actions.c:953:30: note: uninitialized use occurs here
>     ../ovn/lib/actions.c:932:17: note: remove the 'if' if its condition is
> always true
>     ../ovn/lib/actions.c:886:13: note: variable 'dst' is declared here
>
> I can't figure out what it's talking about, and I can't figure out a
> simple way to suppress it.  Do you have any idea?
>

I see what's wrong. There is a declaration of a "dst" variable in an inner
scope that shadows the declaration of a "dst" variable in an outer scope.
In the case where the if statement is false, the inner scope "dst" gets
declared and its parameters set. What we want is for the outer scope "dst"
to have its parameters set in that case. The easy solution is just to
remove the inner scope declaration of dst. I'll do that and repost the
patch.


More information about the dev mailing list