Re: [PATCH] geneve: Add missing braces in addr6 initializer

From: Joe Perches
Date: Mon Nov 12 2018 - 17:36:17 EST


On Mon, 2018-11-12 at 15:12 -0700, Nathan Chancellor wrote:
> Clang warns:
>
> drivers/net/geneve.c:428:29: error: suggest braces around initialization
> of subobject [-Werror,-Wmissing-braces]
> struct in6_addr addr6 = { 0 };
> ^
> {}

Perhaps just remove the 0.

> diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
[]
> @@ -425,7 +425,7 @@ static int geneve_udp_encap_err_lookup(struct sock *sk, struct sk_buff *skb)
> #if IS_ENABLED(CONFIG_IPV6)
> if (geneve_get_sk_family(gs) == AF_INET6) {
> struct ipv6hdr *ip6h = ipv6_hdr(skb);
> - struct in6_addr addr6 = { 0 };
> + struct in6_addr addr6 = { { 0 } };
>
> if (!gs->collect_md) {
> vni = geneve_hdr(skb)->vni;