diff options
author | Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> | 2018-04-26 21:58:51 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-27 20:35:22 +0200 |
commit | 800e00c12733fe2ed565206dcdb515fa2f705b9f (patch) | |
tree | 073b2244e2fc44c74187656c97b40ee68486a591 /net/sctp/transport.c | |
parent | sctp: remove old and unused SCTP_MIN_PMTU (diff) | |
download | linux-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.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. */ |