net: ipv4: Add ability to have GRE ignore DF bit in IPv4 payloads
Subsystems (3)
PATCH v2 1/1 net: ipv4: Add ability to have GRE ignore DF bit in IPv4 payloads
From: Philip Prindeville <[email protected]>
In the presence of firewalls which improperly block ICMP Unreachable (including Fragmentation Required) messages, Path MTU Discovery is prevented from working.
A workaround is to handle IPv4 payloads opaquely, ignoring the DF bit--as is done for other payloads like AppleTalk--and doing transparent fragmentation and reassembly.
Redux includes the enforcement of mutual exclusion between this feature and Path MTU Discovery as suggested by Alexander Duyck.
--- include/net/ip_tunnels.h | 1 + include/uapi/linux/if_tunnel.h | 1 + net/ipv4/ip_gre.c | 42 +++++++++++++++++++++++++++++++++--------- net/ipv4/ip_tunnel.c | 2 +- 4 files changed, 36 insertions(+), 10 deletions(-)
include/net/ip_tunnels.h +1 -0
@@ -132,6 +132,7 @@ struct ip_tunnel {int ip_tnl_net_id;struct gro_cells gro_cells;bool collect_md; +bool ignore_df; };#define TUNNEL_CSUM __cpu_to_be16(0x01)
include/uapi/linux/if_tunnel.h +1 -0
@@ -113,6 +113,7 @@ enum {IFLA_GRE_ENCAP_SPORT ,IFLA_GRE_ENCAP_DPORT ,IFLA_GRE_COLLECT_METADATA , +IFLA_GRE_IGNORE_DF , __IFLA_GRE_MAX, };
net/ipv4/ip_gre.c +33 -9
116 lines not on this page · raw message
net/ipv4/ip_tunnel.c +1 -1
@@ -682,7 +682,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, } df = tnl_params->frag_off; -if (skb->protocol ==htons (ETH_P_IP )) +if (skb->protocol ==htons (ETH_P_IP ) && !tunnel->ignore_df) df |= (inner_iph->frag_off&htons (IP_DF )); max_headroom =LL_RESERVED_SPACE (rt->dst.dev) +sizeof (struct iphdr )
From: "Philip Prindeville" <[email protected]>
Date: Tue, 14 Jun 2016 15:53:02 -0600
Quoted 10 lines
From: Philip Prindeville <[email protected]>
In the presence of firewalls which improperly block ICMP Unreachable (including Fragmentation Required) messages, Path MTU Discovery is prevented from working.
A workaround is to handle IPv4 payloads opaquely, ignoring the DF bit--as is done for other payloads like AppleTalk--and doing transparent fragmentation and reassembly.
Quoted 6 lines
Redux includes the enforcement of mutual exclusion between this feature and Path MTU Discovery as suggested by Alexander Duyck.
Cc Alexander Duyck <[email protected]>Reviewed-by Stephen Hemminger <[email protected]>Signed-off-by Philip Prindeville <[email protected]>
Applied.