ipvs: implement passive PMTUD for IPIP packets
authorJulian Anastasov <ja@ssi.bg>
Fri, 20 Jul 2012 08:59:52 +0000 (11:59 +0300)
committerSimon Horman <horms@verge.net.au>
Fri, 10 Aug 2012 01:35:03 +0000 (10:35 +0900)
commitf2edb9f7706dcb2c0d9a362b2ba849efe3a97f5e
treea7e92aae534c38c59e3a08a8497ba80e764d436a
parent2b2d280817bd576e97ccd243b9b3a344d11ddd11
ipvs: implement passive PMTUD for IPIP packets

IPVS is missing the logic to update PMTU in routing
for its IPIP packets. We monitor the dst_mtu and can return
FRAG_NEEDED messages but if the tunneled packets get ICMP
error we can not rely on other traffic to save the lowest
MTU.

The following patch adds ICMP handling for IPIP
packets in incoming direction, from some remote host to
our local IP used as saddr in the outer header. By this
way we can forward any related ICMP traffic if it is for IPVS
TUN connection. For the special case of PMTUD we update the
routing and if client requested DF we can forward the
error.

To properly update the routing we have to bind
the cached route (dest->dst_cache) to the selected saddr
because ipv4_update_pmtu uses saddr for dst lookup.
Add IP_VS_RT_MODE_CONNECT flag to force such binding with
second route.

Update ip_vs_tunnel_xmit to provide IP_VS_RT_MODE_CONNECT
and change the code to copy DF. For now we prefer not to
force PMTU discovery (outer DF=1) because we don't have
configuration option to enable or disable PMTUD. As we
do not keep any packets to resend, we prefer not to
play games with packets without DF bit because the sender
is not informed when they are rejected.

Also, change ops->update_pmtu to be called only
for local clients because there is no point to update
MTU for input routes, in our case skb->dst->dev is lo.
It seems the code is copied from ipip.c where the skb
dst points to tunnel device.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
net/netfilter/ipvs/ip_vs_core.c
net/netfilter/ipvs/ip_vs_xmit.c
This page took 0.028267 seconds and 5 git commands to generate.