diff --git a/src/compat/Kbuild.include b/src/compat/Kbuild.include index a0c2af76..0192ecdc 100644 --- a/src/compat/Kbuild.include +++ b/src/compat/Kbuild.include @@ -69,6 +69,10 @@ ifeq ($(wildcard $(srctree)/arch/arm64/include/asm/neon.h)$(CONFIG_ARM64),y) ccflags-y += -I$(kbuild-dir)/compat/neon-arm/include endif +ifeq ($(wildcard $(srctree)/include/net/dst_metadata.h),) +ccflags-y += -I$(kbuild-dir)/compat/dstmetadata/include +endif + ifeq ($(CONFIG_X86_64),y) ifeq ($(ssse3_instr),) ssse3_instr := $(call as-instr,pshufb %xmm0$(comma)%xmm0,-DCONFIG_AS_SSSE3=1) diff --git a/src/compat/dstmetadata/include/net/dst_metadata.h b/src/compat/dstmetadata/include/net/dst_metadata.h new file mode 100644 index 00000000..e22d0b74 --- /dev/null +++ b/src/compat/dstmetadata/include/net/dst_metadata.h @@ -0,0 +1,3 @@ +#ifndef skb_valid_dst +#define skb_valid_dst(skb) skb_dst(skb) +#endif diff --git a/src/device.c b/src/device.c index ece4ad2d..062490f1 100644 --- a/src/device.c +++ b/src/device.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -160,7 +161,7 @@ static netdev_tx_t wg_xmit(struct sk_buff *skb, struct net_device *dev) goto err_peer; } - mtu = skb_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu; + mtu = skb_valid_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu; __skb_queue_head_init(&packets); if (!skb_is_gso(skb)) {