]> git.itanic.dy.fi Git - linux-stable/commit
ip6_gre: Make o_seqno start from 0 in native mode
authorPeilin Ye <peilin.ye@bytedance.com>
Thu, 21 Apr 2022 22:08:38 +0000 (15:08 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 11:42:10 +0000 (12:42 +0100)
commit6fe9988585a657d98b036284c66b4df40694dea1
tree4309d42c2124240c33f54f62ecfd2f7a90c0cb3f
parentc0df813cbedcee5c4a6fc5d000786190588d7d83
ip6_gre: Make o_seqno start from 0 in native mode

[ Upstream commit fde98ae91f79cab4e020f40c35ed23cbdc59661c ]

For IP6GRE and IP6GRETAP devices, currently o_seqno starts from 1 in
native mode.  According to RFC 2890 2.2., "The first datagram is sent
with a sequence number of 0."  Fix it.

It is worth mentioning that o_seqno already starts from 0 in collect_md
mode, see the "if (tunnel->parms.collect_md)" clause in __gre6_xmit(),
where tunnel->o_seqno is passed to gre_build_header() before getting
incremented.

Fixes: c12b395a4664 ("gre: Support GRE over IPv6")
Signed-off-by: Peilin Ye <peilin.ye@bytedance.com>
Acked-by: William Tu <u9012063@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv6/ip6_gre.c