Skip to content

Commit cc4665c

Browse files
lxindavem330
authored andcommitted
sctp: subtract sctphdr len in sctp_transport_pl_hlen
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: d9e2e41 ("sctp: add the constants/variables and states and some APIs for transport") Signed-off-by: Xin Long <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c6ea04e commit cc4665c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/net/sctp/sctp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,8 @@ static inline __u32 sctp_min_frag_point(struct sctp_sock *sp, __u16 datasize)
626626

627627
static inline int sctp_transport_pl_hlen(struct sctp_transport *t)
628628
{
629-
return __sctp_mtu_payload(sctp_sk(t->asoc->base.sk), t, 0, 0);
629+
return __sctp_mtu_payload(sctp_sk(t->asoc->base.sk), t, 0, 0) -
630+
sizeof(struct sctphdr);
630631
}
631632

632633
static inline void sctp_transport_pl_reset(struct sctp_transport *t)

0 commit comments

Comments
 (0)