Skip to content

Commit

Permalink
geneve: Initialize addr6 with memset
Browse files Browse the repository at this point in the history
Clang warns:

drivers/net/geneve.c:428:29: error: suggest braces around initialization
of subobject [-Werror,-Wmissing-braces]
                struct in6_addr addr6 = { 0 };
                                          ^
                                          {}

Rather than trying to appease the various compilers that support the
kernel, use memset, which is unambiguous.

Fixes: a079664 ("geneve: ICMP error lookup handler")
Suggested-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nathan Chancellor authored and David S. Miller committed Nov 18, 2018
1 parent 52c951f commit 8a962c4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/geneve.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,9 @@ 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;

memset(&addr6, 0, sizeof(struct in6_addr));

if (!gs->collect_md) {
vni = geneve_hdr(skb)->vni;
Expand Down

0 comments on commit 8a962c4

Please sign in to comment.