Skip to content

Commit e3cebcd

Browse files
skorpion17gregkh
authored andcommitted
seg6: fix seg6 lwtunnel output redirect for L2 reduced encap mode
commit ade67d5 upstream. When SEG6_IPTUN_MODE_L2ENCAP_RED (L2ENCAP_RED) was introduced, the condition in seg6_build_state() that excludes L2 encap modes from setting LWTUNNEL_STATE_OUTPUT_REDIRECT was not updated to account for the new mode. As a consequence, L2ENCAP_RED routes incorrectly trigger seg6_output() on the output path, where the packet is silently dropped because skb_mac_header_was_set() fails on L3 packets. Extend the check to also exclude L2ENCAP_RED, consistent with L2ENCAP. Fixes: 13f0296 ("seg6: add support for SRv6 H.L2Encaps.Red behavior") Cc: stable@vger.kernel.org Signed-off-by: Andrea Mayer <andrea.mayer@uniroma2.it> Reviewed-by: Justin Iurman <justin.iurman@gmail.com> Link: https://patch.msgid.link/20260418162838.31979-1-andrea.mayer@uniroma2.it Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 262152e commit e3cebcd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

net/ipv6/seg6_iptunnel.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,8 @@ static int seg6_build_state(struct net *net, struct nlattr *nla,
711711
newts->type = LWTUNNEL_ENCAP_SEG6;
712712
newts->flags |= LWTUNNEL_STATE_INPUT_REDIRECT;
713713

714-
if (tuninfo->mode != SEG6_IPTUN_MODE_L2ENCAP)
714+
if (tuninfo->mode != SEG6_IPTUN_MODE_L2ENCAP &&
715+
tuninfo->mode != SEG6_IPTUN_MODE_L2ENCAP_RED)
715716
newts->flags |= LWTUNNEL_STATE_OUTPUT_REDIRECT;
716717

717718
newts->headroom = seg6_lwt_headroom(tuninfo);

0 commit comments

Comments
 (0)