* [PATCH] arp: fixed -Wuninitialized compiler warning
@ 2017-05-24 22:19 Ihar Hrachyshka
2017-05-25 17:38 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Ihar Hrachyshka @ 2017-05-24 22:19 UTC (permalink / raw)
To: davem, ja; +Cc: Ihar Hrachyshka, netdev
Commit 7d472a59c0e5ec117220a05de6b370447fb6cb66 ("arp: always override
existing neigh entries with gratuitous ARP") introduced a compiler
warning:
net/ipv4/arp.c:880:35: warning: 'addr_type' may be used uninitialized in
this function [-Wmaybe-uninitialized]
While the code logic seems to be correct and doesn't allow the variable
to be used uninitialized, and the warning is not consistently
reproducible, it's still worth fixing it for other people not to waste
time looking at the warning in case it pops up in the build environment.
Yes, compiler is probably at fault, but we will need to accommodate.
Fixes: 7d472a59c0e5ec117220a05de6b370447fb6cb66
Signed-off-by: Ihar Hrachyshka <ihrachys@redhat.com>
---
net/ipv4/arp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index ae96e6f..e9f3386 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -863,8 +863,8 @@ static int arp_process(struct net *net, struct sock *sk, struct sk_buff *skb)
n = __neigh_lookup(&arp_tbl, &sip, dev, 0);
+ addr_type = -1;
if (n || IN_DEV_ARP_ACCEPT(in_dev)) {
- addr_type = -1;
is_garp = arp_is_garp(net, dev, &addr_type, arp->ar_op,
sip, tip, sha, tha);
}
--
2.9.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] arp: fixed -Wuninitialized compiler warning
2017-05-24 22:19 [PATCH] arp: fixed -Wuninitialized compiler warning Ihar Hrachyshka
@ 2017-05-25 17:38 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-05-25 17:38 UTC (permalink / raw)
To: ihrachys; +Cc: ja, netdev
From: Ihar Hrachyshka <ihrachys@redhat.com>
Date: Wed, 24 May 2017 15:19:35 -0700
> Commit 7d472a59c0e5ec117220a05de6b370447fb6cb66 ("arp: always override
> existing neigh entries with gratuitous ARP") introduced a compiler
> warning:
>
> net/ipv4/arp.c:880:35: warning: 'addr_type' may be used uninitialized in
> this function [-Wmaybe-uninitialized]
>
> While the code logic seems to be correct and doesn't allow the variable
> to be used uninitialized, and the warning is not consistently
> reproducible, it's still worth fixing it for other people not to waste
> time looking at the warning in case it pops up in the build environment.
> Yes, compiler is probably at fault, but we will need to accommodate.
>
> Fixes: 7d472a59c0e5ec117220a05de6b370447fb6cb66
> Signed-off-by: Ihar Hrachyshka <ihrachys@redhat.com>
Applied, but please in the future format your Fixes: tag properly
which should have been:
Fixes: 7d472a59c0e5 ("arp: always override existing neigh entries with gratuitous ARP")
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-25 17:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-24 22:19 [PATCH] arp: fixed -Wuninitialized compiler warning Ihar Hrachyshka
2017-05-25 17:38 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).