diff --git a/src/device.c b/src/device.c index 88790d6..42ded33 100644 --- a/src/device.c +++ b/src/device.c @@ -119,6 +119,7 @@ static netdev_tx_t xmit(struct sk_buff *skb, struct net_device *dev) struct wireguard_peer *peer; struct sk_buff *next; struct sk_buff_head packets; + struct dst_entry *dst; sa_family_t family; u32 mtu; int ret; @@ -143,7 +144,8 @@ static netdev_tx_t xmit(struct sk_buff *skb, struct net_device *dev) goto err_peer; } - mtu = dst_mtu(skb_dst(skb)); + dst = skb_dst(skb); + mtu = dst ? dst_mtu(dst) : dev->mtu; __skb_queue_head_init(&packets); if (!skb_is_gso(skb))