[PATCH v2] ipv4: Correct/silence an endian warning in __ip_do_redirect

Kunwu Chan posted 1 patch 2 years, 1 month ago
net/ipv4/route.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v2] ipv4: Correct/silence an endian warning in __ip_do_redirect
Posted by Kunwu Chan 2 years, 1 month ago
net/ipv4/route.c:783:46: warning: incorrect type in argument 2 (different base types)
net/ipv4/route.c:783:46:    expected unsigned int [usertype] key
net/ipv4/route.c:783:46:    got restricted __be32 [usertype] new_gw

Fixes: 969447f226b4 ("ipv4: use new_gw for redirect neigh lookup")
Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
---
 net/ipv4/route.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 3290a4442b4a..16615d107cf0 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -780,7 +780,7 @@ static void __ip_do_redirect(struct rtable *rt, struct sk_buff *skb, struct flow
 			goto reject_redirect;
 	}
 
-	n = __ipv4_neigh_lookup(rt->dst.dev, new_gw);
+	n = __ipv4_neigh_lookup(rt->dst.dev, (__force u32)new_gw);
 	if (!n)
 		n = neigh_create(&arp_tbl, &new_gw, rt->dst.dev);
 	if (!IS_ERR(n)) {
-- 
2.34.1
Re: [PATCH v2] ipv4: Correct/silence an endian warning in __ip_do_redirect
Posted by patchwork-bot+netdevbpf@kernel.org 2 years, 1 month ago
Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Sun, 19 Nov 2023 22:17:59 +0800 you wrote:
> net/ipv4/route.c:783:46: warning: incorrect type in argument 2 (different base types)
> net/ipv4/route.c:783:46:    expected unsigned int [usertype] key
> net/ipv4/route.c:783:46:    got restricted __be32 [usertype] new_gw
> 
> Fixes: 969447f226b4 ("ipv4: use new_gw for redirect neigh lookup")
> Suggested-by: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
> 
> [...]

Here is the summary with links:
  - [v2] ipv4: Correct/silence an endian warning in __ip_do_redirect
    https://git.kernel.org/netdev/net/c/c0e2926266af

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html