]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
sctp: subtract sctphdr len in sctp_transport_pl_hlen
authorXin Long <lucien.xin@gmail.com>
Thu, 28 Oct 2021 09:36:03 +0000 (05:36 -0400)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:48:26 +0000 (09:48 +0100)
commit34625c93734ef0222baecb56bb903e03156f3e5d
treec359d0b6ecd53dabf6e2ba5d06a32da2b10e1a26
parent80d8a27067e888949d64b52bc1a15f5ec628e3f2
sctp: subtract sctphdr len in sctp_transport_pl_hlen

BugLink: https://bugs.launchpad.net/bugs/1951822
[ Upstream commit cc4665ca646c96181a7c00198aa72c59e0c576e8 ]

sctp_transport_pl_hlen() is called to calculate the outer header length
for PL. However, as the Figure in rfc8899#section-4.4:

   Any additional
     headers         .--- MPS -----.
            |        |             |
            v        v             v
     +------------------------------+
     | IP | ** | PL | protocol data |
     +------------------------------+

                <----- PLPMTU ----->
     <---------- PMTU -------------->

Outer header are IP + Any additional headers, which doesn't include
Packetization Layer itself header, namely sctphdr, whereas sctphdr
is counted by __sctp_mtu_payload().

The incorrect calculation caused the link pathmtu to be set larger
than expected by t->pl.pmtu + sctp_transport_pl_hlen(). This patch
is to fix it by subtracting sctphdr len in sctp_transport_pl_hlen().

Fixes: d9e2e410ae30 ("sctp: add the constants/variables and states and some APIs for transport")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
include/net/sctp/sctp.h