]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: fix csum_ipv6_magic() on little endian platforms
authorChristophe Leroy <christophe.leroy@c-s.fr>
Mon, 10 Sep 2018 06:09:04 +0000 (06:09 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 20 Sep 2018 11:12:28 +0000 (21:12 +1000)
commitb6800208071be4d520e6c95badfb70b99c2b5605
tree3e88a96623dba2fab54fcbff79f49e1483b548c7
parent1cc173fc52efd38f580d0d2d29d4030aaaadd245
powerpc: fix csum_ipv6_magic() on little endian platforms

On little endian platforms, csum_ipv6_magic() keeps len and proto in
CPU byte order. This generates a bad results leading to ICMPv6 packets
from other hosts being dropped by powerpc64le platforms.

In order to fix this, len and proto should be converted to network
byte order ie bigendian byte order. However checksumming 0x12345678
and 0x56341278 provide the exact same result so it is enough to
rotate the sum of len and proto by 1 byte.

PPC32 only support bigendian so the fix is needed for PPC64 only

Fixes: 61046db1a22e ("powerpc: Implement csum_ipv6_magic in assembly")
Reported-by: Jianlin Shi <jishi@redhat.com>
Reported-by: Xin Long <lucien.xin@gmail.com>
Cc: <stable@vger.kernel.org> # 4.18+
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Tested-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/lib/checksum_64.S