diff options
Diffstat (limited to 'net/sctp/sm_sideeffect.c')
-rw-r--r-- | net/sctp/sm_sideeffect.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index a4763fd24fd8..23a9f1a95b7d 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c | |||
@@ -243,7 +243,7 @@ void sctp_generate_t3_rtx_event(unsigned long peer) | |||
243 | 243 | ||
244 | sctp_bh_lock_sock(asoc->base.sk); | 244 | sctp_bh_lock_sock(asoc->base.sk); |
245 | if (sock_owned_by_user(asoc->base.sk)) { | 245 | if (sock_owned_by_user(asoc->base.sk)) { |
246 | SCTP_DEBUG_PRINTK("%s:Sock is busy.\n", __FUNCTION__); | 246 | SCTP_DEBUG_PRINTK("%s:Sock is busy.\n", __func__); |
247 | 247 | ||
248 | /* Try again later. */ | 248 | /* Try again later. */ |
249 | if (!mod_timer(&transport->T3_rtx_timer, jiffies + (HZ/20))) | 249 | if (!mod_timer(&transport->T3_rtx_timer, jiffies + (HZ/20))) |
@@ -283,7 +283,7 @@ static void sctp_generate_timeout_event(struct sctp_association *asoc, | |||
283 | sctp_bh_lock_sock(asoc->base.sk); | 283 | sctp_bh_lock_sock(asoc->base.sk); |
284 | if (sock_owned_by_user(asoc->base.sk)) { | 284 | if (sock_owned_by_user(asoc->base.sk)) { |
285 | SCTP_DEBUG_PRINTK("%s:Sock is busy: timer %d\n", | 285 | SCTP_DEBUG_PRINTK("%s:Sock is busy: timer %d\n", |
286 | __FUNCTION__, | 286 | __func__, |
287 | timeout_type); | 287 | timeout_type); |
288 | 288 | ||
289 | /* Try again later. */ | 289 | /* Try again later. */ |
@@ -361,7 +361,7 @@ void sctp_generate_heartbeat_event(unsigned long data) | |||
361 | 361 | ||
362 | sctp_bh_lock_sock(asoc->base.sk); | 362 | sctp_bh_lock_sock(asoc->base.sk); |
363 | if (sock_owned_by_user(asoc->base.sk)) { | 363 | if (sock_owned_by_user(asoc->base.sk)) { |
364 | SCTP_DEBUG_PRINTK("%s:Sock is busy.\n", __FUNCTION__); | 364 | SCTP_DEBUG_PRINTK("%s:Sock is busy.\n", __func__); |
365 | 365 | ||
366 | /* Try again later. */ | 366 | /* Try again later. */ |
367 | if (!mod_timer(&transport->hb_timer, jiffies + (HZ/20))) | 367 | if (!mod_timer(&transport->hb_timer, jiffies + (HZ/20))) |
@@ -545,14 +545,12 @@ static void sctp_cmd_hb_timers_start(sctp_cmd_seq_t *cmds, | |||
545 | struct sctp_association *asoc) | 545 | struct sctp_association *asoc) |
546 | { | 546 | { |
547 | struct sctp_transport *t; | 547 | struct sctp_transport *t; |
548 | struct list_head *pos; | ||
549 | 548 | ||
550 | /* Start a heartbeat timer for each transport on the association. | 549 | /* Start a heartbeat timer for each transport on the association. |
551 | * hold a reference on the transport to make sure none of | 550 | * hold a reference on the transport to make sure none of |
552 | * the needed data structures go away. | 551 | * the needed data structures go away. |
553 | */ | 552 | */ |
554 | list_for_each(pos, &asoc->peer.transport_addr_list) { | 553 | list_for_each_entry(t, &asoc->peer.transport_addr_list, transports) { |
555 | t = list_entry(pos, struct sctp_transport, transports); | ||
556 | 554 | ||
557 | if (!mod_timer(&t->hb_timer, sctp_transport_timeout(t))) | 555 | if (!mod_timer(&t->hb_timer, sctp_transport_timeout(t))) |
558 | sctp_transport_hold(t); | 556 | sctp_transport_hold(t); |
@@ -563,12 +561,11 @@ static void sctp_cmd_hb_timers_stop(sctp_cmd_seq_t *cmds, | |||
563 | struct sctp_association *asoc) | 561 | struct sctp_association *asoc) |
564 | { | 562 | { |
565 | struct sctp_transport *t; | 563 | struct sctp_transport *t; |
566 | struct list_head *pos; | ||
567 | 564 | ||
568 | /* Stop all heartbeat timers. */ | 565 | /* Stop all heartbeat timers. */ |
569 | 566 | ||
570 | list_for_each(pos, &asoc->peer.transport_addr_list) { | 567 | list_for_each_entry(t, &asoc->peer.transport_addr_list, |
571 | t = list_entry(pos, struct sctp_transport, transports); | 568 | transports) { |
572 | if (del_timer(&t->hb_timer)) | 569 | if (del_timer(&t->hb_timer)) |
573 | sctp_transport_put(t); | 570 | sctp_transport_put(t); |
574 | } | 571 | } |
@@ -579,10 +576,9 @@ static void sctp_cmd_t3_rtx_timers_stop(sctp_cmd_seq_t *cmds, | |||
579 | struct sctp_association *asoc) | 576 | struct sctp_association *asoc) |
580 | { | 577 | { |
581 | struct sctp_transport *t; | 578 | struct sctp_transport *t; |
582 | struct list_head *pos; | ||
583 | 579 | ||
584 | list_for_each(pos, &asoc->peer.transport_addr_list) { | 580 | list_for_each_entry(t, &asoc->peer.transport_addr_list, |
585 | t = list_entry(pos, struct sctp_transport, transports); | 581 | transports) { |
586 | if (timer_pending(&t->T3_rtx_timer) && | 582 | if (timer_pending(&t->T3_rtx_timer) && |
587 | del_timer(&t->T3_rtx_timer)) { | 583 | del_timer(&t->T3_rtx_timer)) { |
588 | sctp_transport_put(t); | 584 | sctp_transport_put(t); |
@@ -593,7 +589,6 @@ static void sctp_cmd_t3_rtx_timers_stop(sctp_cmd_seq_t *cmds, | |||
593 | 589 | ||
594 | /* Helper function to update the heartbeat timer. */ | 590 | /* Helper function to update the heartbeat timer. */ |
595 | static void sctp_cmd_hb_timer_update(sctp_cmd_seq_t *cmds, | 591 | static void sctp_cmd_hb_timer_update(sctp_cmd_seq_t *cmds, |
596 | struct sctp_association *asoc, | ||
597 | struct sctp_transport *t) | 592 | struct sctp_transport *t) |
598 | { | 593 | { |
599 | /* Update the heartbeat timer. */ | 594 | /* Update the heartbeat timer. */ |
@@ -1065,7 +1060,6 @@ static int sctp_cmd_interpreter(sctp_event_t event_type, | |||
1065 | struct sctp_chunk *new_obj; | 1060 | struct sctp_chunk *new_obj; |
1066 | struct sctp_chunk *chunk = NULL; | 1061 | struct sctp_chunk *chunk = NULL; |
1067 | struct sctp_packet *packet; | 1062 | struct sctp_packet *packet; |
1068 | struct list_head *pos; | ||
1069 | struct timer_list *timer; | 1063 | struct timer_list *timer; |
1070 | unsigned long timeout; | 1064 | unsigned long timeout; |
1071 | struct sctp_transport *t; | 1065 | struct sctp_transport *t; |
@@ -1397,9 +1391,8 @@ static int sctp_cmd_interpreter(sctp_event_t event_type, | |||
1397 | /* If we've sent any data bundled with | 1391 | /* If we've sent any data bundled with |
1398 | * COOKIE-ECHO we need to resend. | 1392 | * COOKIE-ECHO we need to resend. |
1399 | */ | 1393 | */ |
1400 | list_for_each(pos, &asoc->peer.transport_addr_list) { | 1394 | list_for_each_entry(t, &asoc->peer.transport_addr_list, |
1401 | t = list_entry(pos, struct sctp_transport, | 1395 | transports) { |
1402 | transports); | ||
1403 | sctp_retransmit_mark(&asoc->outqueue, t, | 1396 | sctp_retransmit_mark(&asoc->outqueue, t, |
1404 | SCTP_RTXR_T1_RTX); | 1397 | SCTP_RTXR_T1_RTX); |
1405 | } | 1398 | } |
@@ -1457,7 +1450,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type, | |||
1457 | 1450 | ||
1458 | case SCTP_CMD_HB_TIMER_UPDATE: | 1451 | case SCTP_CMD_HB_TIMER_UPDATE: |
1459 | t = cmd->obj.transport; | 1452 | t = cmd->obj.transport; |
1460 | sctp_cmd_hb_timer_update(commands, asoc, t); | 1453 | sctp_cmd_hb_timer_update(commands, t); |
1461 | break; | 1454 | break; |
1462 | 1455 | ||
1463 | case SCTP_CMD_HB_TIMERS_STOP: | 1456 | case SCTP_CMD_HB_TIMERS_STOP: |