aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2009-09-04 18:21:01 -0400
committerVlad Yasevich <vladislav.yasevich@hp.com>2009-09-04 18:21:01 -0400
commit8da645e101a8c20c6073efda3c7cc74eec01b87f (patch)
tree3d888e6da02f60acb18b52f6e6d8dac64e28564c /net/sctp
parenta803c942303e6a4ef0ab6b80114529852cffa058 (diff)
sctp: Get rid of an extra routing lookup when adding a transport.
We used to perform 2 routing lookups for a new transport: one just for path mtu detection, and one to actually route to destination and path mtu update when sending a packet. There is no point in doing both of them, especially since the first one just for path mtu doesn't take into account source address and sometimes gives the wrong route, causing path mtu updates anyway. We now do just the one call to do both route to destination and get path mtu updates. Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/associola.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index caba989f4e76..8450960df24f 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -680,13 +680,15 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,
680 */ 680 */
681 peer->param_flags = asoc->param_flags; 681 peer->param_flags = asoc->param_flags;
682 682
683 sctp_transport_route(peer, NULL, sp);
684
683 /* Initialize the pmtu of the transport. */ 685 /* Initialize the pmtu of the transport. */
684 if (peer->param_flags & SPP_PMTUD_ENABLE) 686 if (peer->param_flags & SPP_PMTUD_DISABLE) {
685 sctp_transport_pmtu(peer); 687 if (asoc->pathmtu)
686 else if (asoc->pathmtu) 688 peer->pathmtu = asoc->pathmtu;
687 peer->pathmtu = asoc->pathmtu; 689 else
688 else 690 peer->pathmtu = SCTP_DEFAULT_MAXSEGMENT;
689 peer->pathmtu = SCTP_DEFAULT_MAXSEGMENT; 691 }
690 692
691 /* If this is the first transport addr on this association, 693 /* If this is the first transport addr on this association,
692 * initialize the association PMTU to the peer's PMTU. 694 * initialize the association PMTU to the peer's PMTU.