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>
*/
peer->param_flags = asoc->param_flags;
- sctp_transport_route(peer, NULL, sp);
-
/* Initialize the pmtu of the transport. */
- if (peer->param_flags & SPP_PMTUD_DISABLE) {
- if (asoc->pathmtu)
- peer->pathmtu = asoc->pathmtu;
- else
- peer->pathmtu = SCTP_DEFAULT_MAXSEGMENT;
- }
+ sctp_transport_route(peer, NULL, sp);
/* If this is the first transport addr on this association,
* initialize the association PMTU to the peer's PMTU.
* 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. */