Skip to content

Commit 659e0bc

Browse files
marceloleitnerdavem330
authored andcommitted
sctp: keep fragmentation point aligned to word size
If the user supply a different fragmentation point or if there is a network header that cause it to not be aligned, force it to be aligned. Fragmentation point at a value that is not aligned is not optimal. It causes extra padding to be used and has just no pros. v2: - Make use of the new WORD_TRUNC macro Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3822a5f commit 659e0bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/net/sctp/sctp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ static inline int sctp_frag_point(const struct sctp_association *asoc, int pmtu)
431431
if (asoc->user_frag)
432432
frag = min_t(int, frag, asoc->user_frag);
433433

434-
frag = min_t(int, frag, SCTP_MAX_CHUNK_LEN);
434+
frag = WORD_TRUNC(min_t(int, frag, SCTP_MAX_CHUNK_LEN));
435435

436436
return frag;
437437
}

0 commit comments

Comments
 (0)