diff options
author | Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> | 2018-04-26 16:58:57 -0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-25 11:26:12 +0200 |
commit | 1ef66ca6fc045d9da6e4eb0231b2b38da2ce5604 (patch) | |
tree | 6178a006b0ca684b3fe8366c7570339558c74192 /include | |
parent | 41822076f67fd02693f38350d05988c8b18dc989 (diff) | |
download | linux-stable-1ef66ca6fc045d9da6e4eb0231b2b38da2ce5604.tar.gz linux-stable-1ef66ca6fc045d9da6e4eb0231b2b38da2ce5604.tar.bz2 linux-stable-1ef66ca6fc045d9da6e4eb0231b2b38da2ce5604.zip |
sctp: introduce sctp_dst_mtu
[ Upstream commit 6ff0f871c20ec1769a481edca86f23c76b2b06d3 ]
Which makes sure that the MTU respects the minimum value of
SCTP_DEFAULT_MINSEGMENT and that it is correctly aligned.
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/sctp/sctp.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 35498e613ff5..edfa9d0f6005 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -609,10 +609,15 @@ static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport * return t->dst; } +static inline __u32 sctp_dst_mtu(const struct dst_entry *dst) +{ + return SCTP_TRUNC4(max_t(__u32, dst_mtu(dst), + SCTP_DEFAULT_MINSEGMENT)); +} + static inline bool sctp_transport_pmtu_check(struct sctp_transport *t) { - __u32 pmtu = max_t(size_t, SCTP_TRUNC4(dst_mtu(t->dst)), - SCTP_DEFAULT_MINSEGMENT); + __u32 pmtu = sctp_dst_mtu(t->dst); if (t->pathmtu == pmtu) return true; |