From: David Lebrun Date: Wed, 16 Nov 2016 09:05:46 +0000 (+0100) Subject: lwtunnel: subtract tunnel headroom from mtu on output redirect X-Git-Tag: v4.14-rc1~1973^2~250 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a23a8f5bc17e6209eefadcd1cb3d3e28a2cdf530;p=platform%2Fkernel%2Flinux-rpi3.git lwtunnel: subtract tunnel headroom from mtu on output redirect This patch changes the lwtunnel_headroom() function which is called in ipv4_mtu() and ip6_mtu(), to also return the correct headroom value when the lwtunnel state is OUTPUT_REDIRECT. This patch enables e.g. SR-IPv6 encapsulations to work without manually setting the route mtu. Acked-by: Roopa Prabhu Signed-off-by: David Lebrun Signed-off-by: David S. Miller --- diff --git a/include/net/lwtunnel.h b/include/net/lwtunnel.h index 82e76fe..d4c1c75 100644 --- a/include/net/lwtunnel.h +++ b/include/net/lwtunnel.h @@ -94,7 +94,8 @@ static inline bool lwtunnel_xmit_redirect(struct lwtunnel_state *lwtstate) static inline unsigned int lwtunnel_headroom(struct lwtunnel_state *lwtstate, unsigned int mtu) { - if (lwtunnel_xmit_redirect(lwtstate) && lwtstate->headroom < mtu) + if ((lwtunnel_xmit_redirect(lwtstate) || + lwtunnel_output_redirect(lwtstate)) && lwtstate->headroom < mtu) return lwtstate->headroom; return 0;