summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_pcb.c
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2007-03-31 11:47:30 +0000
committerrrs <rrs@FreeBSD.org>2007-03-31 11:47:30 +0000
commit9afebb96fc58efdcb69e55a2863d17e89d803dbe (patch)
treefc7c5aaca2d2ae2e7c1e6abe827b9f910acb9e6b /sys/netinet/sctp_pcb.c
parent897ccc3f10f608b560a198d5f41a22991a08559f (diff)
downloadFreeBSD-src-9afebb96fc58efdcb69e55a2863d17e89d803dbe.zip
FreeBSD-src-9afebb96fc58efdcb69e55a2863d17e89d803dbe.tar.gz
- Found bug in min split point bundling which caused
incorrect, non-bundlable fragmentation. - Added min residual to better control split points for both how big a msg must be as well as how much needs to be left over. - With our new algo in place, we need to implicitly set "end of msg" on the sp-> structure otherwise we end up with "hung" associations. - Room reserved up front in IP header by pushing IP header to back of mbuf. - Fix so FR's peg count of retransmissions needed. - Fix so an unlucky chunk that never gets across will kill the assoc via the kill timer and send an abort too. - Fix bug in sctp_input which can result in a crash. - Do not strip off IP options anymore. - Clean up sctp_calculate_rto(). - Get rid of unused sysctl. - Fixed so we discard all M-Cast - Fixed so port check done AFTER checksum - Fixed bug in fragmentation code that prevented us from fragmenting a small complete message when we needed to. - Window probes were not marked back to unsent and flight adjusted when a sack came in with no window change or accepting of the probe data. We now fix this with having a mark on the net and the chunk so we can clear it out when the sack arrives forcing it to retran just like it was "new" this improves the handling of window probes, which were dropped by the receiver. - Tighten AUTH protocol error checks during INIT/INIT-ACK exchange
Diffstat (limited to 'sys/netinet/sctp_pcb.c')
-rw-r--r--sys/netinet/sctp_pcb.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index b2197e3..ac9c196 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -3887,7 +3887,6 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_inpcbfre
asoc->streamoutcnt = 0;
if (asoc->strmin) {
struct sctp_queued_to_read *ctl;
- int i;
for (i = 0; i < asoc->streamincnt; i++) {
if (!TAILQ_EMPTY(&asoc->strmin[i].inqueue)) {
@@ -4530,7 +4529,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m,
struct sockaddr_in sin;
struct sockaddr_in6 sin6;
uint8_t random_store[SCTP_PARAM_BUFFER_SIZE];
- struct sctp_auth_random *random = NULL;
+ struct sctp_auth_random *p_random = NULL;
uint16_t random_len = 0;
uint8_t hmacs_store[SCTP_PARAM_BUFFER_SIZE];
struct sctp_auth_hmac_algo *hmacs = NULL;
@@ -4887,8 +4886,8 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m,
plen);
if (phdr == NULL)
return (-26);
- random = (struct sctp_auth_random *)phdr;
- random_len = plen - sizeof(*random);
+ p_random = (struct sctp_auth_random *)phdr;
+ random_len = plen - sizeof(*p_random);
/* enforce the random length */
if (random_len != SCTP_AUTH_RANDOM_SIZE_REQUIRED) {
#ifdef SCTP_DEBUG
@@ -5007,9 +5006,14 @@ next_param:
} else {
stcb->asoc.peer_supports_auth = 0;
}
+ if (!stcb->asoc.peer_supports_auth && got_chklist) {
+ /* peer does not support auth but sent a chunks list? */
+ return (-31);
+ }
if (!sctp_asconf_auth_nochk && stcb->asoc.peer_supports_asconf &&
!stcb->asoc.peer_supports_auth) {
- return (-31);
+ /* peer supports asconf but not auth? */
+ return (-32);
}
/* concatenate the full random key */
#ifdef SCTP_AUTH_DRAFT_04
@@ -5017,18 +5021,18 @@ next_param:
new_key = sctp_alloc_key(keylen);
if (new_key != NULL) {
/* copy in the RANDOM */
- if (random != NULL)
- bcopy(random->random_data, new_key->key, random_len);
+ if (p_random != NULL)
+ bcopy(p_random->random_data, new_key->key, random_len);
}
#else
- keylen = sizeof(*random) + random_len + sizeof(*chunks) + num_chunks +
+ keylen = sizeof(*p_random) + random_len + sizeof(*chunks) + num_chunks +
sizeof(*hmacs) + hmacs_len;
new_key = sctp_alloc_key(keylen);
if (new_key != NULL) {
/* copy in the RANDOM */
- if (random != NULL) {
- keylen = sizeof(*random) + random_len;
- bcopy(random, new_key->key, keylen);
+ if (p_random != NULL) {
+ keylen = sizeof(*p_random) + random_len;
+ bcopy(p_random, new_key->key, keylen);
}
/* append in the AUTH chunks */
if (chunks != NULL) {
@@ -5044,7 +5048,8 @@ next_param:
}
#endif
else {
- return (-32);
+ /* failed to get memory for the key */
+ return (-33);
}
if (stcb->asoc.authinfo.peer_random != NULL)
sctp_free_key(stcb->asoc.authinfo.peer_random);
OpenPOWER on IntegriCloud