]> git.baikalelectronics.ru Git - kernel.git/commit
net: ip_finish_output_gso: Allow fragmenting segments of tunneled skbs if their DF...
authorShmulik Ladkani <shmulik.ladkani@gmail.com>
Sun, 21 Aug 2016 08:22:32 +0000 (11:22 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Aug 2016 00:11:01 +0000 (17:11 -0700)
commit4782500b859ab67ca264d828a7e19abdeeaf29c5
tree69cd46d3d12be3fc41ab056891cbdfe4e2f08e38
parent14202e89bbdf9bf6c6b7f97f87c86dbafc4d6fcf
net: ip_finish_output_gso: Allow fragmenting segments of tunneled skbs if their DF is unset

In be097d6531,

   "net: ip_finish_output_gso: If skb_gso_network_seglen exceeds MTU, allow segmentation for local udp tunneled skbs"

gso skbs arriving from an ingress interface that go through UDP
tunneling, are allowed to be fragmented if the resulting encapulated
segments exceed the dst mtu of the egress interface.

This aligned the behavior of gso skbs to non-gso skbs going through udp
encapsulation path.

However the non-gso vs gso anomaly is present also in the following
cases of a GRE tunnel:
 - ip_gre in collect_md mode, where TUNNEL_DONT_FRAGMENT is not set
   (e.g. OvS vport-gre with df_default=false)
 - ip_gre in nopmtudisc mode, where IFLA_GRE_IGNORE_DF is set

In both of the above cases, the non-gso skbs get fragmented, whereas the
gso skbs (having skb_gso_network_seglen that exceeds dst mtu) get dropped,
as they don't go through the segment+fragment code path.

Fix: Setting IPSKB_FRAG_SEGS if the tunnel specified IP_DF bit is NOT set.

Tunnels that do set IP_DF, will not go to fragmentation of segments.
This preserves behavior of ip_gre in (the default) pmtudisc mode.

Fixes: be097d6531 ("net: ip_finish_output_gso: If skb_gso_network_seglen exceeds MTU, allow segmentation for local udp tunneled skbs")
Reported-by: wenxu <wenxu@ucloud.cn>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Tested-by: wenxu <wenxu@ucloud.cn>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_tunnel_core.c