diff options
author | t00fcxen <t00fcxen> | 2014-09-16 14:25:27 +0000 |
---|---|---|
committer | t00fcxen <t00fcxen> | 2014-09-16 14:25:27 +0000 |
commit | c5fe9aa6ae8b12577aa961421b64104d82964e6a (patch) | |
tree | 4e05c810dc53c66d6e4b63c00bd9547d01a9f8a5 | |
parent | 970c7e801c8a672b25793da4c3b06c47b21a2099 (diff) | |
download | usrsctplib-c5fe9aa6ae8b12577aa961421b64104d82964e6a.tar.gz |
Sync with Mavericks sources.
git-svn-id: http://sctp-refimpl.googlecode.com/svn/trunk/KERN/usrsctp/usrsctplib@9023 9df1edf5-d72c-5b5f-11c0-5f5209eb73f7
-rwxr-xr-x | netinet/sctp_auth.c | 8 | ||||
-rwxr-xr-x | netinet/sctp_auth.h | 4 | ||||
-rwxr-xr-x | netinet/sctp_pcb.c | 6 | ||||
-rwxr-xr-x | netinet/sctp_usrreq.c | 7 |
4 files changed, 13 insertions, 12 deletions
diff --git a/netinet/sctp_auth.c b/netinet/sctp_auth.c index 00ff978..50432ad 100755 --- a/netinet/sctp_auth.c +++ b/netinet/sctp_auth.c @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctp_auth.c 269858 2014-08-12 11:30:16Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_auth.c 271673 2014-09-16 14:20:33Z tuexen $"); #endif #include <netinet/sctp_os.h> @@ -633,7 +633,7 @@ sctp_copy_skeylist(const struct sctp_keyhead *src, struct sctp_keyhead *dest) sctp_hmaclist_t * -sctp_alloc_hmaclist(uint8_t num_hmacs) +sctp_alloc_hmaclist(uint16_t num_hmacs) { sctp_hmaclist_t *new_list; int alloc_size; @@ -1464,8 +1464,8 @@ sctp_auth_get_cookie_params(struct sctp_tcb *stcb, struct mbuf *m, p_random = (struct sctp_auth_random *)phdr; random_len = plen - sizeof(*p_random); } else if (ptype == SCTP_HMAC_LIST) { - int num_hmacs; - int i; + uint16_t num_hmacs; + uint16_t i; if (plen > sizeof(hmacs_store)) break; diff --git a/netinet/sctp_auth.h b/netinet/sctp_auth.h index 04649ad..9973893 100755 --- a/netinet/sctp_auth.h +++ b/netinet/sctp_auth.h @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctp_auth.h 269858 2014-08-12 11:30:16Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_auth.h 271673 2014-09-16 14:20:33Z tuexen $"); #endif #ifndef _NETINET_SCTP_AUTH_H_ @@ -149,7 +149,7 @@ extern void sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t keyid, /* hmac list handling */ -extern sctp_hmaclist_t *sctp_alloc_hmaclist(uint8_t num_hmacs); +extern sctp_hmaclist_t *sctp_alloc_hmaclist(uint16_t num_hmacs); extern void sctp_free_hmaclist(sctp_hmaclist_t *list); extern int sctp_auth_add_hmacid(sctp_hmaclist_t *list, uint16_t hmac_id); extern sctp_hmaclist_t *sctp_copy_hmaclist(sctp_hmaclist_t *list); diff --git a/netinet/sctp_pcb.c b/netinet/sctp_pcb.c index ffe8f62..9e0145e 100755 --- a/netinet/sctp_pcb.c +++ b/netinet/sctp_pcb.c @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 271230 2014-09-07 18:05:37Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 271673 2014-09-16 14:20:33Z tuexen $"); #endif #include <netinet/sctp_os.h> @@ -7528,8 +7528,8 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m, } got_random = 1; } else if (ptype == SCTP_HMAC_LIST) { - int num_hmacs; - int i; + uint16_t num_hmacs; + uint16_t i; if (plen > sizeof(hmacs_store)) break; diff --git a/netinet/sctp_usrreq.c b/netinet/sctp_usrreq.c index 296b9f3..3c134f8 100755 --- a/netinet/sctp_usrreq.c +++ b/netinet/sctp_usrreq.c @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctp_usrreq.c 271221 2014-09-07 09:06:26Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_usrreq.c 271673 2014-09-16 14:20:33Z tuexen $"); #endif #include <netinet/sctp_os.h> @@ -5027,13 +5027,14 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, uint32_t i; SCTP_CHECK_AND_CAST(shmac, optval, struct sctp_hmacalgo, optsize); - if (optsize < sizeof(struct sctp_hmacalgo) + shmac->shmac_number_of_idents * sizeof(uint16_t)) { + if ((optsize < sizeof(struct sctp_hmacalgo) + shmac->shmac_number_of_idents * sizeof(uint16_t)) || + (shmac->shmac_number_of_idents > 0xffff)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; } - hmaclist = sctp_alloc_hmaclist(shmac->shmac_number_of_idents); + hmaclist = sctp_alloc_hmaclist((uint16_t)shmac->shmac_number_of_idents); if (hmaclist == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOMEM); error = ENOMEM; |