Skip to content
This repository has been archived by the owner on Dec 27, 2019. It is now read-only.

Commit

Permalink
socket: set ignore_df=1 on xmit
Browse files Browse the repository at this point in the history
This allows the kernel to generate ipv6 fragments. Apply the same
to ipv4 for consistency.

Signed-off-by: Joe Holden <[email protected]>
  • Loading branch information
jwh authored and zx2c4 committed May 12, 2019
1 parent 3b8affc commit 8416093
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/compat/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,9 @@ struct __kernel_timespec {
#define skb_probe_transport_header(a) skb_probe_transport_header(a, 0)
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0) && !defined(ISRHEL7)
#define ignore_df local_df
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
/* Note that all intentional uses of the non-_bh variety need to explicitly
Expand Down
3 changes: 3 additions & 0 deletions src/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ static int send4(struct wg_device *wg, struct sk_buff *skb,
if (cache)
dst_cache_set_ip4(cache, &rt->dst, fl.saddr);
}

skb->ignore_df = 1;
udp_tunnel_xmit_skb(rt, sock, skb, fl.saddr, fl.daddr, ds,
ip4_dst_hoplimit(&rt->dst), 0, fl.fl4_sport,
fl.fl4_dport, false, false);
Expand Down Expand Up @@ -157,6 +159,7 @@ static int send6(struct wg_device *wg, struct sk_buff *skb,
dst_cache_set_ip6(cache, dst, &fl.saddr);
}

skb->ignore_df = 1;
udp_tunnel6_xmit_skb(dst, sock, skb, skb->dev, &fl.saddr, &fl.daddr, ds,
ip6_dst_hoplimit(dst), 0, fl.fl6_sport,
fl.fl6_dport, false);
Expand Down

0 comments on commit 8416093

Please sign in to comment.