diff options
| author | Michael Tuexen <tuexen@FreeBSD.org> | 2010-01-18 21:25:12 +0000 |
|---|---|---|
| committer | Michael Tuexen <tuexen@FreeBSD.org> | 2010-01-18 21:25:12 +0000 |
| commit | e4bea23fa6f08044ec8f828a781007b665b40456 (patch) | |
| tree | ea9e784de669064995f10547febd1882d3b925ce /sys/netinet | |
| parent | 4443d59a907724a4c7bce161941af46228f2e7f2 (diff) | |
Notes
Diffstat (limited to 'sys/netinet')
| -rw-r--r-- | sys/netinet/sctp_pcb.c | 26 | ||||
| -rw-r--r-- | sys/netinet/sctputil.c | 28 |
2 files changed, 14 insertions, 40 deletions
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 51f06f9725b6..1d372c212751 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -4102,9 +4102,6 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(stcb->asoc.my_vtag, SCTP_BASE_INFO(hashasocmark))]; /* put it in the bucket in the vtag hash of assoc's for the system */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); -#ifdef MICHAELS_EXPERIMENT - sctp_delete_from_timewait(stcb->asoc.my_vtag, inp->sctp_lport, stcb->rport); -#endif SCTP_INP_INFO_WUNLOCK(); if ((err = sctp_add_remote_addr(stcb, firstaddr, SCTP_DO_SETSCOPE, SCTP_ALLOC_ASOC))) { @@ -4117,6 +4114,10 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, SCTP_FREE(asoc->mapping_array, SCTP_M_MAP); asoc->mapping_array = NULL; } + if (asoc->nr_mapping_array) { + SCTP_FREE(asoc->nr_mapping_array, SCTP_M_MAP); + asoc->nr_mapping_array = NULL; + } SCTP_DECR_ASOC_COUNT(); SCTP_TCB_LOCK_DESTROY(stcb); SCTP_TCB_SEND_LOCK_DESTROY(stcb); @@ -4879,6 +4880,10 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_inpcbfre SCTP_FREE(asoc->mapping_array, SCTP_M_MAP); asoc->mapping_array = NULL; } + if (asoc->nr_mapping_array) { + SCTP_FREE(asoc->nr_mapping_array, SCTP_M_MAP); + asoc->nr_mapping_array = NULL; + } /* the stream outs */ if (asoc->strmout) { SCTP_FREE(asoc->strmout, SCTP_M_STRMO); @@ -6361,21 +6366,6 @@ skip_vtag_check: } } SCTP_INP_INFO_RUNLOCK(); -#ifdef MICHAELS_EXPERIMENT - /*- - * Not found, ok to use the tag, add it to the time wait hash - * as well this will prevent two sucessive cookies from getting - * the same tag or two inits sent quickly on multi-processors. - * We only keep the tag for the life of a cookie and when we - * add this tag to the assoc hash we need to purge it from - * the t-wait hash. - */ - SCTP_INP_INFO_WLOCK(); - if (save_in_twait) - sctp_add_vtag_to_timewait(tag, TICKS_TO_SEC(inp->sctp_ep.def_cookie_life, lport, rport)); - SCTP_INP_INFO_WUNLOCK(); -#endif - return (1); } diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index ce068530aaea..d8b874171f12 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -912,24 +912,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); } @@ -1154,11 +1137,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 */ |
