Commit 800e00c1 authored by Marcelo Ricardo Leitner's avatar Marcelo Ricardo Leitner Committed by David S. Miller

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: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c45698f8
...@@ -652,15 +652,8 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc, ...@@ -652,15 +652,8 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,
*/ */
peer->param_flags = asoc->param_flags; peer->param_flags = asoc->param_flags;
sctp_transport_route(peer, NULL, sp);
/* Initialize the pmtu of the transport. */ /* Initialize the pmtu of the transport. */
if (peer->param_flags & SPP_PMTUD_DISABLE) { sctp_transport_route(peer, NULL, sp);
if (asoc->pathmtu)
peer->pathmtu = asoc->pathmtu;
else
peer->pathmtu = SCTP_DEFAULT_MAXSEGMENT;
}
/* If this is the first transport addr on this association, /* If this is the first transport addr on this association,
* initialize the association PMTU to the peer's PMTU. * initialize the association PMTU to the peer's PMTU.
......
...@@ -310,8 +310,12 @@ void sctp_transport_route(struct sctp_transport *transport, ...@@ -310,8 +310,12 @@ void sctp_transport_route(struct sctp_transport *transport,
(transport == asoc->peer.active_path))) (transport == asoc->peer.active_path)))
opt->pf->to_sk_saddr(&transport->saddr, opt->pf->to_sk_saddr(&transport->saddr,
asoc->base.sk); 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; transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT;
}
} }
/* Hold a reference to a transport. */ /* Hold a reference to a transport. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment