aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/associola.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/associola.c')
-rw-r--r--net/sctp/associola.c42
1 files changed, 7 insertions, 35 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 8d3aef9d0615..39f5166ae7af 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -1284,49 +1284,21 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc)
1284 ntohs(t->ipaddr.v4.sin_port)); 1284 ntohs(t->ipaddr.v4.sin_port));
1285} 1285}
1286 1286
1287/* Choose the transport for sending a INIT packet. */ 1287/* Choose the transport for sending retransmit packet. */
1288struct sctp_transport *sctp_assoc_choose_init_transport( 1288struct sctp_transport *sctp_assoc_choose_alter_transport(
1289 struct sctp_association *asoc) 1289 struct sctp_association *asoc, struct sctp_transport *last_sent_to)
1290{ 1290{
1291 struct sctp_transport *t; 1291 /* If this is the first time packet is sent, use the active path,
1292 1292 * else use the retran path. If the last packet was sent over the
1293 /* Use the retran path. If the last INIT was sent over the
1294 * retran path, update the retran path and use it. 1293 * retran path, update the retran path and use it.
1295 */ 1294 */
1296 if (!asoc->init_last_sent_to) { 1295 if (!last_sent_to)
1297 t = asoc->peer.active_path;
1298 } else {
1299 if (asoc->init_last_sent_to == asoc->peer.retran_path)
1300 sctp_assoc_update_retran_path(asoc);
1301 t = asoc->peer.retran_path;
1302 }
1303
1304 SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_update_retran_path:association"
1305 " %p addr: ",
1306 " port: %d\n",
1307 asoc,
1308 (&t->ipaddr),
1309 ntohs(t->ipaddr.v4.sin_port));
1310
1311 return t;
1312}
1313
1314/* Choose the transport for sending a SHUTDOWN packet. */
1315struct sctp_transport *sctp_assoc_choose_shutdown_transport(
1316 struct sctp_association *asoc)
1317{
1318 /* If this is the first time SHUTDOWN is sent, use the active path,
1319 * else use the retran path. If the last SHUTDOWN was sent over the
1320 * retran path, update the retran path and use it.
1321 */
1322 if (!asoc->shutdown_last_sent_to)
1323 return asoc->peer.active_path; 1296 return asoc->peer.active_path;
1324 else { 1297 else {
1325 if (asoc->shutdown_last_sent_to == asoc->peer.retran_path) 1298 if (last_sent_to == asoc->peer.retran_path)
1326 sctp_assoc_update_retran_path(asoc); 1299 sctp_assoc_update_retran_path(asoc);
1327 return asoc->peer.retran_path; 1300 return asoc->peer.retran_path;
1328 } 1301 }
1329
1330} 1302}
1331 1303
1332/* Update the association's pmtu and frag_point by going through all the 1304/* Update the association's pmtu and frag_point by going through all the