Skip to content

Commit a23a8f5

Browse files
David Lebrundavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David Lebrun <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d331d30 commit a23a8f5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/net/lwtunnel.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ static inline bool lwtunnel_xmit_redirect(struct lwtunnel_state *lwtstate)
9494
static inline unsigned int lwtunnel_headroom(struct lwtunnel_state *lwtstate,
9595
unsigned int mtu)
9696
{
97-
if (lwtunnel_xmit_redirect(lwtstate) && lwtstate->headroom < mtu)
97+
if ((lwtunnel_xmit_redirect(lwtstate) ||
98+
lwtunnel_output_redirect(lwtstate)) && lwtstate->headroom < mtu)
9899
return lwtstate->headroom;
99100

100101
return 0;

0 commit comments

Comments
 (0)