Deleted Added
full compact
sctp_asconf.c (172137) sctp_asconf.c (172157)
1/*-
2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * a) Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.

--- 17 unchanged lines hidden (view full) ---

26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/* $KAME: sctp_asconf.c,v 1.24 2005/03/06 16:04:16 itojun Exp $ */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * a) Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.

--- 17 unchanged lines hidden (view full) ---

26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/* $KAME: sctp_asconf.c,v 1.24 2005/03/06 16:04:16 itojun Exp $ */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_asconf.c 172137 2007-09-10 21:01:56Z rrs $");
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_asconf.c 172157 2007-09-13 14:43:54Z rrs $");
35#include <netinet/sctp_os.h>
36#include <netinet/sctp_var.h>
37#include <netinet/sctp_sysctl.h>
38#include <netinet/sctp_pcb.h>
39#include <netinet/sctp_header.h>
40#include <netinet/sctputil.h>
41#include <netinet/sctp_output.h>
42#include <netinet/sctp_asconf.h>

--- 938 unchanged lines hidden (view full) ---

981sctp_move_chunks_from_deleted_prim(struct sctp_tcb *stcb, struct sctp_nets *dst)
982{
983 struct sctp_association *asoc;
984 struct sctp_stream_out *outs;
985 struct sctp_tmit_chunk *chk;
986 struct sctp_stream_queue_pending *sp;
987
988 if (dst->dest_state & SCTP_ADDR_UNCONFIRMED) {
35#include <netinet/sctp_os.h>
36#include <netinet/sctp_var.h>
37#include <netinet/sctp_sysctl.h>
38#include <netinet/sctp_pcb.h>
39#include <netinet/sctp_header.h>
40#include <netinet/sctputil.h>
41#include <netinet/sctp_output.h>
42#include <netinet/sctp_asconf.h>

--- 938 unchanged lines hidden (view full) ---

981sctp_move_chunks_from_deleted_prim(struct sctp_tcb *stcb, struct sctp_nets *dst)
982{
983 struct sctp_association *asoc;
984 struct sctp_stream_out *outs;
985 struct sctp_tmit_chunk *chk;
986 struct sctp_stream_queue_pending *sp;
987
988 if (dst->dest_state & SCTP_ADDR_UNCONFIRMED) {
989 SCTPDBG(SCTP_DEBUG_ASCONF1, "move_chunks_from_deleted_prim: specified destination is UNCONFIRMED\n");
990 return;
991 }
992 if (stcb->asoc.deleted_primary == NULL) {
989 return;
990 }
991 if (stcb->asoc.deleted_primary == NULL) {
993 SCTPDBG(SCTP_DEBUG_ASCONF1, "move_chunks_from_deleted_prim: Funny, old primary is not stored\n");
994 return;
995 }
996 asoc = &stcb->asoc;
997
998 /*
999 * now through all the streams checking for chunks sent to our bad
1000 * network.
1001 */

--- 21 unchanged lines hidden (view full) ---

1023extern int cur_oerr;
1024
1025void
1026sctp_assoc_immediate_retrans(struct sctp_tcb *stcb, struct sctp_nets *dstnet)
1027{
1028 int error;
1029
1030 if (dstnet->dest_state & SCTP_ADDR_UNCONFIRMED) {
992 return;
993 }
994 asoc = &stcb->asoc;
995
996 /*
997 * now through all the streams checking for chunks sent to our bad
998 * network.
999 */

--- 21 unchanged lines hidden (view full) ---

1021extern int cur_oerr;
1022
1023void
1024sctp_assoc_immediate_retrans(struct sctp_tcb *stcb, struct sctp_nets *dstnet)
1025{
1026 int error;
1027
1028 if (dstnet->dest_state & SCTP_ADDR_UNCONFIRMED) {
1031 SCTPDBG(SCTP_DEBUG_ASCONF1, "assoc_immediate_retrans: specified destination is UNCONFIRMED\n");
1032 return;
1033 }
1034 if (stcb->asoc.deleted_primary == NULL) {
1029 return;
1030 }
1031 if (stcb->asoc.deleted_primary == NULL) {
1035 SCTPDBG(SCTP_DEBUG_ASCONF1, "assoc_immediate_retrans: Funny, old primary is not stored\n");
1036 return;
1037 }
1038 if (!TAILQ_EMPTY(&stcb->asoc.sent_queue)) {
1032 return;
1033 }
1034 if (!TAILQ_EMPTY(&stcb->asoc.sent_queue)) {
1039 SCTPDBG(SCTP_DEBUG_ASCONF1, "Deleted primary is ");
1035 SCTPDBG(SCTP_DEBUG_ASCONF1, "assoc_immediate_retrans: Deleted primary is ");
1040 SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, &stcb->asoc.deleted_primary->ro._l_addr.sa);
1041 SCTPDBG(SCTP_DEBUG_ASCONF1, "Current Primary is ");
1042 SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, &stcb->asoc.primary_destination->ro._l_addr.sa);
1036 SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, &stcb->asoc.deleted_primary->ro._l_addr.sa);
1037 SCTPDBG(SCTP_DEBUG_ASCONF1, "Current Primary is ");
1038 SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, &stcb->asoc.primary_destination->ro._l_addr.sa);
1043 SCTPDBG(SCTP_DEBUG_ASCONF1, "Stopping send timer and calling t3rxt_timer\n");
1044 sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb,
1045 stcb->asoc.deleted_primary,
1046 SCTP_FROM_SCTP_TIMER + SCTP_LOC_8);
1047 stcb->asoc.num_send_timers_up--;
1048 if (stcb->asoc.num_send_timers_up < 0) {
1049 stcb->asoc.num_send_timers_up = 0;
1050 }
1051 SCTP_TCB_LOCK_ASSERT(stcb);
1052 cur_oerr = stcb->asoc.overall_error_count;
1053 error = sctp_t3rxt_timer(stcb->sctp_ep, stcb,
1054 stcb->asoc.deleted_primary);
1055 if (error) {
1039 sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb,
1040 stcb->asoc.deleted_primary,
1041 SCTP_FROM_SCTP_TIMER + SCTP_LOC_8);
1042 stcb->asoc.num_send_timers_up--;
1043 if (stcb->asoc.num_send_timers_up < 0) {
1044 stcb->asoc.num_send_timers_up = 0;
1045 }
1046 SCTP_TCB_LOCK_ASSERT(stcb);
1047 cur_oerr = stcb->asoc.overall_error_count;
1048 error = sctp_t3rxt_timer(stcb->sctp_ep, stcb,
1049 stcb->asoc.deleted_primary);
1050 if (error) {
1056 SCTPDBG(SCTP_DEBUG_ASCONF1, "t3rxt_timer error\n");
1057 SCTP_INP_DECR_REF(stcb->sctp_ep);
1058 return;
1059 }
1060 SCTP_TCB_LOCK_ASSERT(stcb);
1061#ifdef SCTP_AUDITING_ENABLED
1062 sctp_auditing(4, stcb->sctp_ep, stcb->asoc.deleted_primary);
1063#endif
1064 sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_NOT_LOCKED);

--- 12 unchanged lines hidden (view full) ---

1077static int
1078 sctp_asconf_queue_mgmt(struct sctp_tcb *, struct sctp_ifa *, uint16_t);
1079
1080void
1081sctp_net_immediate_retrans(struct sctp_tcb *stcb, struct sctp_nets *net)
1082{
1083 struct sctp_tmit_chunk *chk;
1084
1051 SCTP_INP_DECR_REF(stcb->sctp_ep);
1052 return;
1053 }
1054 SCTP_TCB_LOCK_ASSERT(stcb);
1055#ifdef SCTP_AUDITING_ENABLED
1056 sctp_auditing(4, stcb->sctp_ep, stcb->asoc.deleted_primary);
1057#endif
1058 sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_NOT_LOCKED);

--- 12 unchanged lines hidden (view full) ---

1071static int
1072 sctp_asconf_queue_mgmt(struct sctp_tcb *, struct sctp_ifa *, uint16_t);
1073
1074void
1075sctp_net_immediate_retrans(struct sctp_tcb *stcb, struct sctp_nets *net)
1076{
1077 struct sctp_tmit_chunk *chk;
1078
1085 SCTPDBG(SCTP_DEBUG_ASCONF1, "net_immediate_retrans:\n");
1086 SCTPDBG(SCTP_DEBUG_ASCONF1, "RTO is %d\n", net->RTO);
1079 SCTPDBG(SCTP_DEBUG_ASCONF1, "net_immediate_retrans: RTO is %d\n", net->RTO);
1087 sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net,
1088 SCTP_FROM_SCTP_TIMER + SCTP_LOC_5);
1089 stcb->asoc.cc_functions.sctp_set_initial_cc_param(stcb, net);
1090 net->error_count = 0;
1091 TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) {
1092 if (chk->whoTo == net) {
1093 if (chk->sent < SCTP_DATAGRAM_RESEND) {
1094 chk->sent = SCTP_DATAGRAM_RESEND;

--- 1968 unchanged lines hidden ---
1080 sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net,
1081 SCTP_FROM_SCTP_TIMER + SCTP_LOC_5);
1082 stcb->asoc.cc_functions.sctp_set_initial_cc_param(stcb, net);
1083 net->error_count = 0;
1084 TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) {
1085 if (chk->whoTo == net) {
1086 if (chk->sent < SCTP_DATAGRAM_RESEND) {
1087 chk->sent = SCTP_DATAGRAM_RESEND;

--- 1968 unchanged lines hidden ---