MFC r271643:
Chunk IDs are 8 bit entities, not 16 bit. Thanks to Peter Kasting from Google for drawing my attention to it. MFC r271665: The MTU is handled as a 32-bit entity within the SCTP stack. This was reported by Peter Kasting from Google. MFC r271670: Make a type conversion explicit. When compiling this code on Windows as part of the SCTP userland stack, this fixes a warning reported by Peter Kasting from Google. MFC r271672: Small cleanup which addresses a warning regaring the truncation of a 64-bit entity to a 32-bit entity. This issue was reported by Peter Kasting from Google. MFC r271673: Use a consistent type for the number of HMAC algorithms. This fixes a bug which resulted in a warning on the userland stack, when compiled on Windows. Thanks to Peter Kasting from Google for reporting the issue and provinding a potential fix. MFC r271674: Add a explict cast to silence a warning when building the userland stack on Windows. This issue was reported by Peter Kasting from Google. Approved by: re (kib)
This commit is contained in:
parent
30b741cb6c
commit
a2c29a6744
@ -631,7 +631,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;
|
||||
@ -1438,8 +1438,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;
|
||||
|
@ -154,7 +154,7 @@ 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);
|
||||
|
@ -1130,12 +1130,9 @@ sctp_cwnd_update_after_packet_dropped(struct sctp_tcb *stcb,
|
||||
uint32_t * bottle_bw, uint32_t * on_queue)
|
||||
{
|
||||
uint32_t bw_avail;
|
||||
int rtt;
|
||||
unsigned int incr;
|
||||
int old_cwnd = net->cwnd;
|
||||
|
||||
/* need real RTT in msd for this calc */
|
||||
rtt = net->rtt / 1000;
|
||||
/* get bottle neck bw */
|
||||
*bottle_bw = ntohl(cp->bottle_bw);
|
||||
/* and whats on queue */
|
||||
@ -1144,10 +1141,11 @@ sctp_cwnd_update_after_packet_dropped(struct sctp_tcb *stcb,
|
||||
* adjust the on-queue if our flight is more it could be that the
|
||||
* router has not yet gotten data "in-flight" to it
|
||||
*/
|
||||
if (*on_queue < net->flight_size)
|
||||
if (*on_queue < net->flight_size) {
|
||||
*on_queue = net->flight_size;
|
||||
/* calculate the available space */
|
||||
bw_avail = (*bottle_bw * rtt) / 1000;
|
||||
}
|
||||
/* rtt is measured in micro seconds, bottle_bw in bytes per second */
|
||||
bw_avail = (uint32_t) (((uint64_t) (*bottle_bw) * net->rtt) / (uint64_t) 1000000);
|
||||
if (bw_avail > *bottle_bw) {
|
||||
/*
|
||||
* Cap the growth to no more than the bottle neck. This can
|
||||
@ -1167,7 +1165,6 @@ sctp_cwnd_update_after_packet_dropped(struct sctp_tcb *stcb,
|
||||
int seg_inflight, seg_onqueue, my_portion;
|
||||
|
||||
net->partial_bytes_acked = 0;
|
||||
|
||||
/* how much are we over queue size? */
|
||||
incr = *on_queue - bw_avail;
|
||||
if (stcb->asoc.seen_a_sack_this_pkt) {
|
||||
|
@ -322,7 +322,7 @@ typedef struct callout sctp_os_timer_t;
|
||||
/* MTU */
|
||||
/*************************/
|
||||
#define SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, af) ((struct ifnet *)ifn)->if_mtu
|
||||
#define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, rt) ((rt != NULL) ? rt->rt_mtu : 0)
|
||||
#define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, rt) ((uint32_t)((rt != NULL) ? rt->rt_mtu : 0))
|
||||
#define SCTP_GATHER_MTU_FROM_INTFC(sctp_ifn) ((sctp_ifn->ifn_p != NULL) ? ((struct ifnet *)(sctp_ifn->ifn_p))->if_mtu : 0)
|
||||
#define SCTP_SET_MTU_OF_ROUTE(sa, rt, mtu) do { \
|
||||
if (rt != NULL) \
|
||||
|
@ -11301,7 +11301,7 @@ sctp_send_hb(struct sctp_tcb *stcb, struct sctp_nets *net, int so_locked
|
||||
hb->heartbeat.hb_info.time_value_1 = now.tv_sec;
|
||||
hb->heartbeat.hb_info.time_value_2 = now.tv_usec;
|
||||
/* Did our user request this one, put it in */
|
||||
hb->heartbeat.hb_info.addr_family = net->ro._l_addr.sa.sa_family;
|
||||
hb->heartbeat.hb_info.addr_family = (uint8_t) net->ro._l_addr.sa.sa_family;
|
||||
hb->heartbeat.hb_info.addr_len = net->ro._l_addr.sa.sa_len;
|
||||
if (net->dest_state & SCTP_ADDR_UNCONFIRMED) {
|
||||
/*
|
||||
|
@ -6513,8 +6513,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;
|
||||
|
@ -418,8 +418,8 @@ TAILQ_HEAD(sctpchunk_listhead, sctp_tmit_chunk);
|
||||
#define CHUNK_FLAGS_FRAGMENT_OK 0x0100
|
||||
|
||||
struct chk_id {
|
||||
uint16_t id;
|
||||
uint16_t can_take_data;
|
||||
uint8_t id;
|
||||
uint8_t can_take_data;
|
||||
};
|
||||
|
||||
|
||||
|
@ -4208,12 +4208,13 @@ 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;
|
||||
|
@ -2403,8 +2403,8 @@ sctp_calculate_rto(struct sctp_tcb *stcb,
|
||||
net->rtt = (uint64_t) 1000000 *(uint64_t) now.tv_sec +
|
||||
(uint64_t) now.tv_usec;
|
||||
|
||||
/* computer rtt in ms */
|
||||
rtt = net->rtt / 1000;
|
||||
/* compute rtt in ms */
|
||||
rtt = (int32_t) (net->rtt / 1000);
|
||||
if ((asoc->cc_functions.sctp_rtt_calculated) && (rtt_from_sack == SCTP_RTT_FROM_DATA)) {
|
||||
/*
|
||||
* Tell the CC module that a new update has just occurred
|
||||
|
Loading…
x
Reference in New Issue
Block a user