summaryrefslogtreecommitdiff
path: root/include/net/lwtunnel.h
diff options
context:
space:
mode:
authorDavid Lebrun <david.lebrun@uclouvain.be>2016-11-16 12:05:46 +0300
committerDavid S. Miller <davem@davemloft.net>2016-11-17 01:01:15 +0300
commita23a8f5bc17e6209eefadcd1cb3d3e28a2cdf530 (patch)
tree000bc1bfe0f3522169d571d5b8b8fe571261b45e /include/net/lwtunnel.h
parentd331d30360d7d10c4150a5a6452bc8d9aeb5784f (diff)
downloadlinux-a23a8f5bc17e6209eefadcd1cb3d3e28a2cdf530.tar.xz
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 <roopa@cumulusnetworks.com> Signed-off-by: David Lebrun <david.lebrun@uclouvain.be> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/lwtunnel.h')
-rw-r--r--include/net/lwtunnel.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/lwtunnel.h b/include/net/lwtunnel.h
index 82e76fe1c1f7..d4c1c75b8862 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;