Skip to content

Commit 539ccea

Browse files
leitaojfvogel
authored andcommitted
arp: switch to dev_getbyhwaddr() in arp_req_set_public()
[ Upstream commit 4eae0ee ] The arp_req_set_public() function is called with the rtnl lock held, which provides enough synchronization protection. This makes the RCU variant of dev_getbyhwaddr() unnecessary. Switch to using the simpler dev_getbyhwaddr() function since we already have the required rtnl locking. This change helps maintain consistency in the networking code by using the appropriate helper function for the existing locking context. Since we're not holding the RCU read lock in arp_req_set_public() existing code could trigger false positive locking warnings. Fixes: 941666c ("net: RCU conversion of dev_getbyhwaddr() and arp_ioctl()") Suggested-by: Kuniyuki Iwashima <[email protected]> Reviewed-by: Kuniyuki Iwashima <[email protected]> Signed-off-by: Breno Leitao <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit c4a0f115326583dfccb99e45a3cb1bc8ef1bedd4) Signed-off-by: Jack Vogel <[email protected]>
1 parent ab2f8e2 commit 539ccea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/arp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ static int arp_req_set_public(struct net *net, struct arpreq *r,
10771077
__be32 mask = ((struct sockaddr_in *)&r->arp_netmask)->sin_addr.s_addr;
10781078

10791079
if (!dev && (r->arp_flags & ATF_COM)) {
1080-
dev = dev_getbyhwaddr_rcu(net, r->arp_ha.sa_family,
1080+
dev = dev_getbyhwaddr(net, r->arp_ha.sa_family,
10811081
r->arp_ha.sa_data);
10821082
if (!dev)
10831083
return -ENODEV;

0 commit comments

Comments
 (0)