aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/associola.c18
-rw-r--r--net/sctp/sm_statefuns.c2
2 files changed, 4 insertions, 16 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 43cd0dd9149d..fa261a3594c2 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -66,13 +66,6 @@ static void sctp_assoc_bh_rcv(struct work_struct *work);
66static void sctp_assoc_free_asconf_acks(struct sctp_association *asoc); 66static void sctp_assoc_free_asconf_acks(struct sctp_association *asoc);
67static void sctp_assoc_free_asconf_queue(struct sctp_association *asoc); 67static void sctp_assoc_free_asconf_queue(struct sctp_association *asoc);
68 68
69/* Keep track of the new idr low so that we don't re-use association id
70 * numbers too fast. It is protected by they idr spin lock is in the
71 * range of 1 - INT_MAX.
72 */
73static u32 idr_low = 1;
74
75
76/* 1st Level Abstractions. */ 69/* 1st Level Abstractions. */
77 70
78/* Initialize a new association from provided memory. */ 71/* Initialize a new association from provided memory. */
@@ -1079,7 +1072,7 @@ struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *asoc,
1079 transports) { 1072 transports) {
1080 1073
1081 if (transport == active) 1074 if (transport == active)
1082 break; 1075 continue;
1083 list_for_each_entry(chunk, &transport->transmitted, 1076 list_for_each_entry(chunk, &transport->transmitted,
1084 transmitted_list) { 1077 transmitted_list) {
1085 if (key == chunk->subh.data_hdr->tsn) { 1078 if (key == chunk->subh.data_hdr->tsn) {
@@ -1601,13 +1594,8 @@ int sctp_assoc_set_id(struct sctp_association *asoc, gfp_t gfp)
1601 if (preload) 1594 if (preload)
1602 idr_preload(gfp); 1595 idr_preload(gfp);
1603 spin_lock_bh(&sctp_assocs_id_lock); 1596 spin_lock_bh(&sctp_assocs_id_lock);
1604 /* 0 is not a valid id, idr_low is always >= 1 */ 1597 /* 0 is not a valid assoc_id, must be >= 1 */
1605 ret = idr_alloc(&sctp_assocs_id, asoc, idr_low, 0, GFP_NOWAIT); 1598 ret = idr_alloc_cyclic(&sctp_assocs_id, asoc, 1, 0, GFP_NOWAIT);
1606 if (ret >= 0) {
1607 idr_low = ret + 1;
1608 if (idr_low == INT_MAX)
1609 idr_low = 1;
1610 }
1611 spin_unlock_bh(&sctp_assocs_id_lock); 1599 spin_unlock_bh(&sctp_assocs_id_lock);
1612 if (preload) 1600 if (preload)
1613 idr_preload_end(); 1601 idr_preload_end();
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 5131fcfedb03..de1a0138317f 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -2082,7 +2082,7 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(struct net *net,
2082 } 2082 }
2083 2083
2084 /* Delete the tempory new association. */ 2084 /* Delete the tempory new association. */
2085 sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc)); 2085 sctp_add_cmd_sf(commands, SCTP_CMD_SET_ASOC, SCTP_ASOC(new_asoc));
2086 sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL()); 2086 sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());
2087 2087
2088 /* Restore association pointer to provide SCTP command interpeter 2088 /* Restore association pointer to provide SCTP command interpeter