net: don't call update_pmtu unconditionally
Some dst_ops (e.g. md_dst_ops)) doesn't set this handler. It may result to: "BUG: unable to handle kernel NULL pointer dereference at (null)" Let's add a helper to check if update_pmtu is available before calling it. Fixes:52a589d51f
("geneve: update skb dst pmtu on tx path") Fixes:a93bf0ff44
("vxlan: update skb dst pmtu on tx path") CC: Roman Kapl <code@rkapl.cz> CC: Xin Long <lucien.xin@gmail.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
4ee806d511
commit
f15ca723c1
@@ -934,8 +934,8 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
|
||||
df = 0;
|
||||
}
|
||||
|
||||
if (tunnel->parms.iph.daddr && skb_dst(skb))
|
||||
skb_dst(skb)->ops->update_pmtu(skb_dst(skb), NULL, skb, mtu);
|
||||
if (tunnel->parms.iph.daddr)
|
||||
skb_dst_update_pmtu(skb, mtu);
|
||||
|
||||
if (skb->len > mtu && !skb_is_gso(skb)) {
|
||||
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
|
||||
|
Reference in New Issue
Block a user