Skip to content

Commit

Permalink
lwtunnel: subtract tunnel headroom from mtu on output redirect
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Lebrun authored and David S. Miller committed Nov 16, 2016
1 parent d331d30 commit a23a8f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/net/lwtunnel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a23a8f5

Please sign in to comment.