Skip to content

Commit 4eae0ee

Browse files
leitaokuba-moo
authored andcommitted
arp: switch to dev_getbyhwaddr() in arp_req_set_public()
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]>
1 parent 4b5a28b commit 4eae0ee

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)