summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctputil.c
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2009-05-30 10:56:27 +0000
committerrrs <rrs@FreeBSD.org>2009-05-30 10:56:27 +0000
commit138c7701ba283e55cdbfdc609ff46dc403482a8e (patch)
tree0eafcf3af43c9c179c4f126f8c36b987d16c2009 /sys/netinet/sctputil.c
parentb2dff4f4a9fcbfe52715e8530c4a7993bac02f9e (diff)
downloadFreeBSD-src-138c7701ba283e55cdbfdc609ff46dc403482a8e.zip
FreeBSD-src-138c7701ba283e55cdbfdc609ff46dc403482a8e.tar.gz
Fix a small memory leak from the nr-sack code - the mapping array
was not being freed at term of association. Also get rid of the MICHAELS_EXP code.
Diffstat (limited to 'sys/netinet/sctputil.c')
-rw-r--r--sys/netinet/sctputil.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index aea7376..8797d71 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -917,24 +917,7 @@ sctp_init_asoc(struct sctp_inpcb *m, struct sctp_tcb *stcb,
#endif
asoc->sb_send_resv = 0;
if (override_tag) {
-#ifdef MICHAELS_EXPERIMENT
- if (sctp_is_in_timewait(override_tag, stcb->sctp_ep->sctp_lport, stcb->rport)) {
- /*
- * It must be in the time-wait hash, we put it there
- * when we aloc one. If not the peer is playing
- * games.
- */
- asoc->my_vtag = override_tag;
- } else {
- SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ENOMEM);
-#ifdef INVARIANTS
- panic("Huh is_in_timewait fails");
-#endif
- return (ENOMEM);
- }
-#else
asoc->my_vtag = override_tag;
-#endif
} else {
asoc->my_vtag = sctp_select_a_tag(m, stcb->sctp_ep->sctp_lport, stcb->rport, 1);
}
@@ -1159,11 +1142,12 @@ sctp_init_asoc(struct sctp_inpcb *m, struct sctp_tcb *stcb,
asoc->nr_mapping_array_size = SCTP_INITIAL_NR_MAPPING_ARRAY;
SCTP_MALLOC(asoc->nr_mapping_array, uint8_t *, asoc->nr_mapping_array_size,
SCTP_M_MAP);
- /*
- * if (asoc->nr_mapping_array == NULL) { SCTP_FREE(asoc->strmout,
- * SCTP_M_STRMO); SCTP_LTRACE_ERR_RET(NULL, stcb, NULL,
- * SCTP_FROM_SCTPUTIL, ENOMEM); return (ENOMEM); }
- */
+ if (asoc->nr_mapping_array == NULL) {
+ SCTP_FREE(asoc->strmout, SCTP_M_STRMO);
+ SCTP_FREE(asoc->mapping_array, SCTP_M_MAP);
+ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ENOMEM);
+ return (ENOMEM);
+ }
memset(asoc->nr_mapping_array, 0, asoc->nr_mapping_array_size);
/* Now the init of the other outqueues */
OpenPOWER on IntegriCloud