]> git.baikalelectronics.ru Git - kernel.git/commit
inet_ecn: Fix endianness of checksum update when setting ECT(1)
authorToke Høiland-Jørgensen <toke@redhat.com>
Mon, 30 Nov 2020 18:37:05 +0000 (19:37 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 2 Dec 2020 01:16:54 +0000 (17:16 -0800)
commitd2844d7566e688865b0b2974c586e5be1dccb762
tree04680606f370bb8ec9ae5175eb3d28ac6dd0fc11
parent1d6a89e4bd0baf9e35801728b769593dd5817682
inet_ecn: Fix endianness of checksum update when setting ECT(1)

When adding support for propagating ECT(1) marking in IP headers it seems I
suffered from endianness-confusion in the checksum update calculation: In
fact the ECN field is in the *lower* bits of the first 16-bit word of the
IP header when calculating in network byte order. This means that the
addition performed to update the checksum field was wrong; let's fix that.

Fixes: 2732061e4836 ("tunnel: Propagate ECT(1) when decapsulating as recommended by RFC6040")
Reported-by: Jonathan Morton <chromatix99@gmail.com>
Tested-by: Pete Heist <pete@heistp.net>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/r/20201130183705.17540-1-toke@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/inet_ecn.h