Skip to contentSkip to conversation

batman-adv: Fix "Arguments in wrong order" issue

PATCH-net Dheeraj Reddy Jonnalagadda 2 participants 2 messages Nov 15, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

This commit fixes an "Arguments in wrong order" issue detected by Coverity (CID 1376875).

---
 net/batman-adv/distributed-arp-table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/distributed-arp-table.c +1 -1
index 801eff8a40e5..781a5118d441 100644
@@ -1195,7 +1195,7 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv,
 			goto out;
 		}
 
-		skb_new = batadv_dat_arp_create_reply(bat_priv, ip_dst, ip_src,
+		skb_new = batadv_dat_arp_create_reply(bat_priv, ip_src, ip_dst,
 						      dat_entry->mac_addr,
 						      hw_src, vid);
 		if (!skb_new)
Signature · 1 line
2.34.1
maintainer
#1 lore raw

net/batman-adv/

Quoted 9 lines · On Friday, 15 November 2024 05:56:37 CET Dheeraj Reddy Jonnalagadda wrote:

This commit fixes an "Arguments in wrong order" issue detected by Coverity (CID 1376875).

---
 net/batman-adv/distributed-arp-table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/ renamed from net/batman-adv/distributed-arp-table.c +0 -0

distributed-arp-table.c

net/batman-adv/distributed-arp-table.c bool batadv_dat_snoop_outgoing_arp_request(struct

Quoted 4 lines

index 801eff8a40e5..781a5118d441 100644

net/batman-adv/distributed-arp-table.c +0 -0
@@ -1195,7 +1195,7 @@ bool batadv_dat_snoop_outgoing_arp_request(struct 

batadv_priv *bat_priv,

net/batman-adv/distributed-arp-table.c bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv,

Quoted 4 lines
net/batman-adv/distributed-arp-table.c +0 -1
 			goto out;
 		}
 
-		skb_new = batadv_dat_arp_create_reply(bat_priv, ip_dst, 

ip_src,

net/batman-adv/distributed-arp-table.c bool batadv_dat_snoop_outgoing_arp_request(struct · line 1198

Quoted 1 line
net/batman-adv/distributed-arp-table.c +1 -0
+		skb_new = batadv_dat_arp_create_reply(bat_priv, ip_src, 

ip_dst,

Quoted 1 line

dat_entry->mac_addr,

Quoted 1 line

hw_src, vid);

Quoted 2 lines

if (!skb_new)

Sorry, but this is wrong. We send an answer here ("ARP request replied locally") and of course we must then switch src and destination. Otherwise we would send the ARP response to the entity which didn't requested it.

This was already marked as false positive in Coverity a long time ago.

Kind regards,
Sven