ipv4: Correct/silence an endian warning in __ip_do_redirect
authorKunwu Chan <chentao@kylinos.cn>
Sun, 19 Nov 2023 14:17:59 +0000 (22:17 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 21 Nov 2023 11:55:22 +0000 (12:55 +0100)
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>
Link: https://lore.kernel.org/r/20231119141759.420477-1-chentao@kylinos.cn
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/ipv4/route.c

index 3290a4442b4ac746a0ace35f909b95aa6cb9c06c..16615d107cf06f3da7988c8e3ab889456d74dd88 100644 (file)
@@ -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)) {