diff options
author | Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> | 2018-04-26 16:58:51 -0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-27 14:35:22 -0400 |
commit | 800e00c12733fe2ed565206dcdb515fa2f705b9f (patch) | |
tree | 073b2244e2fc44c74187656c97b40ee68486a591 /net/sctp/transport.c | |
parent | c45698f89626177f8c51409142cbe9c5bbed4af7 (diff) | |
download | lwn-800e00c12733fe2ed565206dcdb515fa2f705b9f.tar.gz lwn-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.c | 8 |
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. */ |