netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH-net] batman-adv: Fix "Arguments in wrong order" issue
@ 2024-11-15  4:56 Dheeraj Reddy Jonnalagadda
  2024-11-15  7:14 ` Sven Eckelmann
  0 siblings, 1 reply; 2+ messages in thread
From: Dheeraj Reddy Jonnalagadda @ 2024-11-15  4:56 UTC (permalink / raw)
  To: mareklindner, sw, a, sven
  Cc: davem, edumazet, kuba, pabeni, horms, b.a.t.m.a.n, netdev,
	linux-kernel, Dheeraj Reddy Jonnalagadda

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

Signed-off-by: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
---
 net/batman-adv/distributed-arp-table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index 801eff8a40e5..781a5118d441 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -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)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH-net] batman-adv: Fix "Arguments in wrong order" issue
  2024-11-15  4:56 [PATCH-net] batman-adv: Fix "Arguments in wrong order" issue Dheeraj Reddy Jonnalagadda
@ 2024-11-15  7:14 ` Sven Eckelmann
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Eckelmann @ 2024-11-15  7:14 UTC (permalink / raw)
  To: mareklindner, sw, a, Dheeraj Reddy Jonnalagadda
  Cc: davem, edumazet, kuba, pabeni, horms, b.a.t.m.a.n, netdev,
	linux-kernel, Dheeraj Reddy Jonnalagadda

[-- Attachment #1: Type: text/plain, Size: 1252 bytes --]

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).
> 
> Signed-off-by: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
> ---
>  net/batman-adv/distributed-arp-table.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/
distributed-arp-table.c
> index 801eff8a40e5..781a5118d441 100644
> --- a/net/batman-adv/distributed-arp-table.c
> +++ b/net/batman-adv/distributed-arp-table.c
> @@ -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)
> 

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

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-15  7:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-15  4:56 [PATCH-net] batman-adv: Fix "Arguments in wrong order" issue Dheeraj Reddy Jonnalagadda
2024-11-15  7:14 ` Sven Eckelmann

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).