Skip to content

Commit

Permalink
sctp: keep fragmentation point aligned to word size
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marcelo Ricardo Leitner authored and David S. Miller committed Mar 20, 2016
1 parent 3822a5f commit 659e0bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/net/sctp/sctp.h
Original file line number Diff line number Diff line change
@@ -431,7 +431,7 @@ static inline int sctp_frag_point(const struct sctp_association *asoc, int pmtu)
if (asoc->user_frag)
frag = min_t(int, frag, asoc->user_frag);

frag = min_t(int, frag, SCTP_MAX_CHUNK_LEN);
frag = WORD_TRUNC(min_t(int, frag, SCTP_MAX_CHUNK_LEN));

return frag;
}

0 comments on commit 659e0bc

Please sign in to comment.