]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: get sctphdr by offset in sctp_compute_cksum
authorXin Long <lucien.xin@gmail.com>
Mon, 18 Mar 2019 11:47:00 +0000 (19:47 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Mar 2019 01:16:12 +0000 (18:16 -0700)
commitc67c81b1d21c2702136e6b14e231da373e990f69
tree8429227bffe3b709ddce84b0e841a8ccb851f6b9
parent8d9e509a23eb8775a356fcce5e01b5387daedc50
sctp: get sctphdr by offset in sctp_compute_cksum

sctp_hdr(skb) only works when skb->transport_header is set properly.

But in Netfilter, skb->transport_header for ipv6 is not guaranteed
to be right value for sctphdr. It would cause to fail to check the
checksum for sctp packets.

So fix it by using offset, which is always right in all places.

v1->v2:
  - Fix the changelog.

Fixes: 88a1f8a751ec ("net: sctp: fix and consolidate SCTP checksumming code")
Reported-by: Li Shuang <shuali@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sctp/checksum.h