]> git.baikalelectronics.ru Git - kernel.git/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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Apr 2022 10:40:45 +0000 (11:40 +0100)
commit5c4e17bbb8dffc47417115107534ea32635355d6
treec31fe834e8fae6ea1d6e8121faa212ed1f19f18b
parent0d7ea9f20d468456f69c69b11d65ed00452f9339
ip6_gre: Make o_seqno start from 0 in native mode

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: 3d8fd70921d8 ("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>
net/ipv6/ip6_gre.c