• Xin Long's avatar
    sctp: subtract sctphdr len in sctp_transport_pl_hlen · cc4665ca
    Xin Long authored
    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: d9e2e410 ("sctp: add the constants/variables and states and some APIs for transport")
    Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    cc4665ca
sctp.h 20.3 KB