[ovs-dev] [PATCH] netdev-linux: fix compile error in nl_msg_put_act_police

David Marchand david.marchand at redhat.com
Tue Jul 13 11:58:54 UTC 2021


On Tue, Jul 13, 2021 at 1:34 PM Simon Horman <simon.horman at netronome.com> wrote:
>
> From: Yong Xu <yong.xu at corigine.com>
>
> Use 'memset' to init memory to 0.
>
> This resolves a build problem with clang on Ubuntu 16.04 on ARM (in Travis):
>
> libtool: compile:  clang -DHAVE_CONFIG_H -I. -I ./include -I ./include
> -I ./lib -I ./lib -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare
> -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum
> -Wunused-parameter -Wbad-function-cast -Wcast-align
> -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes
> -Wmissing-field-initializers -Wthread-safety -fno-strict-aliasing
> -Wswitch-bool -Wlogical-not-parentheses -Wsizeof-array-argument
> -Wshift-negative-value -Qunused-arguments -Wshadow
> -Warray-bounds-pointer-arithmetic -Werror -Werror -g -O2
> -Wno-error=unused-command-line-argument -DHAVE_AVX512F -MT
> lib/netlink-conntrack.lo -MD -MP -MF lib/.deps/netlink-conntrack.Tpo
> -c lib/netlink-conntrack.c -o lib/netlink-conntrack.o
> lib/netdev-linux.c:2638:38: error: missing field 'action' initializer
> [-Werror,-Wmissing-field-initializers]
>     struct tc_police null_police = {0};
>                                      ^
> 1 error generated.
> make[2]: *** [lib/netdev-linux.lo] Error 1
> make[2]: *** Waiting for unfinished jobs....
>
> Fixes: c2567e533 ("add port-based ingress policing based packet-per-second rate-limiting")
> Reported-by: David Marchand <david.marchand at redhat.com>
> Signed-off-by: Yong Xu <yong.xu at corigine.com>
> Signed-off-by: Simon Horman <simon.horman at netronome.com>

I used some of the few Travis credits I still have to check this patch.
It fixes the build issue I saw previously.

Patch lgtm, thanks.


-- 
David Marchand



More information about the dev mailing list