]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
net: ipv4: Fix wrong type conversion from hint to rt in ip_route_use_hint()
authorMiaohe Lin <linmiaohe@huawei.com>
Sat, 27 Jun 2020 07:47:51 +0000 (15:47 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 28 Jun 2020 01:02:32 +0000 (18:02 -0700)
We can't cast sk_buff to rtable by (struct rtable *)hint. Use skb_rtable().

Fixes: 02b24941619f ("ipv4: use dst hint for ipv4 list receive")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/route.c

index 1d7076b78e630b7621cd7b87941edda9ebf1cc7c..a01efa062f6bcd16ef3e1f917a0a1397ac7a3507 100644 (file)
@@ -2027,7 +2027,7 @@ int ip_route_use_hint(struct sk_buff *skb, __be32 daddr, __be32 saddr,
                      const struct sk_buff *hint)
 {
        struct in_device *in_dev = __in_dev_get_rcu(dev);
-       struct rtable *rt = (struct rtable *)hint;
+       struct rtable *rt = skb_rtable(hint);
        struct net *net = dev_net(dev);
        int err = -EINVAL;
        u32 tag = 0;