diff options
author | Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> | 2016-03-19 12:17:43 -0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-20 16:31:12 -0400 |
commit | 659e0bcaebc4ca36e64eac6e9f39c1904b17472c (patch) | |
tree | 129c2135a113c80baf5026164e2f9ee097931574 /include | |
parent | 3822a5ff4bc32043fa9c7b6d6f125bcdca6da39c (diff) | |
download | linux-659e0bcaebc4ca36e64eac6e9f39c1904b17472c.tar.bz2 |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/sctp/sctp.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index ad2136caa7d6..65521cfdcade 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -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; } |