diff options
author | Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> | 2018-04-26 21:58:57 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-27 20:35:23 +0200 |
commit | 6ff0f871c20ec1769a481edca86f23c76b2b06d3 (patch) | |
tree | 9fa281c225263df1e1b00e12adfeedfdb6e690f1 /net/sctp | |
parent | sctp: remove sctp_assoc_pending_pmtu (diff) | |
download | linux-6ff0f871c20ec1769a481edca86f23c76b2b06d3.tar.xz linux-6ff0f871c20ec1769a481edca86f23c76b2b06d3.zip |
sctp: introduce sctp_dst_mtu
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>
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/associola.c | 6 | ||||
-rw-r--r-- | net/sctp/transport.c | 6 |
2 files changed, 5 insertions, 7 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c index a29025418b96..039fdb862b17 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c @@ -1405,11 +1405,9 @@ void sctp_assoc_sync_pmtu(struct sctp_association *asoc) return; /* Get the lowest pmtu of all the transports. */ - list_for_each_entry(t, &asoc->peer.transport_addr_list, - transports) { + list_for_each_entry(t, &asoc->peer.transport_addr_list, transports) { if (t->pmtu_pending && t->dst) { - sctp_transport_update_pmtu( - t, SCTP_TRUNC4(dst_mtu(t->dst))); + sctp_transport_update_pmtu(t, sctp_dst_mtu(t->dst)); t->pmtu_pending = 0; } if (!pmtu || (t->pathmtu < pmtu)) diff --git a/net/sctp/transport.c b/net/sctp/transport.c index c5fc3aed08a1..ed73a9d91b83 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c @@ -242,9 +242,9 @@ void sctp_transport_pmtu(struct sctp_transport *transport, struct sock *sk) &transport->fl, sk); } - if (transport->dst) { - transport->pathmtu = SCTP_TRUNC4(dst_mtu(transport->dst)); - } else + if (transport->dst) + transport->pathmtu = sctp_dst_mtu(transport->dst); + else transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; } |