aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2020-06-27 15:47:51 +0800
committerDavid S. Miller <davem@davemloft.net>2020-06-27 18:02:32 -0700
commit2ce578ca9444bb44da66b9a494f56e7ec12e6466 (patch)
tree4c0f249609eb077106267181eddb3e571f82a749 /net
parentenetc: Fix tx rings bitmap iteration range, irq handling (diff)
downloadwireguard-linux-2ce578ca9444bb44da66b9a494f56e7ec12e6466.tar.xz
wireguard-linux-2ce578ca9444bb44da66b9a494f56e7ec12e6466.zip
net: ipv4: Fix wrong type conversion from hint to rt in ip_route_use_hint()
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>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/route.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 1d7076b78e63..a01efa062f6b 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -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;