summaryrefslogtreecommitdiffstats
path: root/net/sctp/transport.c
diff options
context:
space:
mode:
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>2018-04-26 21:58:51 +0200
committerDavid S. Miller <davem@davemloft.net>2018-04-27 20:35:22 +0200
commit800e00c12733fe2ed565206dcdb515fa2f705b9f (patch)
tree073b2244e2fc44c74187656c97b40ee68486a591 /net/sctp/transport.c
parentsctp: remove old and unused SCTP_MIN_PMTU (diff)
downloadlinux-800e00c12733fe2ed565206dcdb515fa2f705b9f.tar.xz
linux-800e00c12733fe2ed565206dcdb515fa2f705b9f.zip
sctp: move transport pathmtu calc away of sctp_assoc_add_peer
There was only one case that sctp_assoc_add_peer couldn't handle, which is when SPP_PMTUD_DISABLE is set and pathmtu not initialized. So add this situation to sctp_transport_route and reuse what was already in there. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/transport.c')
-rw-r--r--net/sctp/transport.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index 47f82bd794d9..c5fc3aed08a1 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -307,11 +307,15 @@ void sctp_transport_route(struct sctp_transport *transport,
* association's active path for getsockname().
*/
if (asoc && (!asoc->peer.primary_path ||
- (transport == asoc->peer.active_path)))
+ (transport == asoc->peer.active_path)))
opt->pf->to_sk_saddr(&transport->saddr,
asoc->base.sk);
- } else
+ } else if ((transport->param_flags & SPP_PMTUD_DISABLE) &&
+ asoc && asoc->pathmtu) {
+ transport->pathmtu = asoc->pathmtu;
+ } else {
transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT;
+ }
}
/* Hold a reference to a transport. */