summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_output.c
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2016-12-29 11:32:42 +0000
committertuexen <tuexen@FreeBSD.org>2016-12-29 11:32:42 +0000
commitea806283fa596574bca077962072e4a9818d67b4 (patch)
treefe09d09de72dfaceba944b7bf7bf505e0e011f89 /sys/netinet/sctp_output.c
parent4ebb8fad2473bd51e0feb9443050793d24f3d2f2 (diff)
downloadFreeBSD-src-ea806283fa596574bca077962072e4a9818d67b4.zip
FreeBSD-src-ea806283fa596574bca077962072e4a9818d67b4.tar.gz
MFC r310590:
Whitespace changes. The toolchain for processing the sources has been updated. No functional change.
Diffstat (limited to 'sys/netinet/sctp_output.c')
-rw-r--r--sys/netinet/sctp_output.c343
1 files changed, 199 insertions, 144 deletions
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index dacbe67..54728ed 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -1937,7 +1937,7 @@ sctp_is_address_in_scope(struct sctp_ifa *ifa,
}
static struct mbuf *
-sctp_add_addr_to_mbuf(struct mbuf *m, struct sctp_ifa *ifa, uint16_t * len)
+sctp_add_addr_to_mbuf(struct mbuf *m, struct sctp_ifa *ifa, uint16_t *len)
{
#if defined(INET) || defined(INET6)
struct sctp_paramhdr *parmh;
@@ -1948,12 +1948,12 @@ sctp_add_addr_to_mbuf(struct mbuf *m, struct sctp_ifa *ifa, uint16_t * len)
switch (ifa->address.sa.sa_family) {
#ifdef INET
case AF_INET:
- plen = (uint16_t) sizeof(struct sctp_ipv4addr_param);
+ plen = (uint16_t)sizeof(struct sctp_ipv4addr_param);
break;
#endif
#ifdef INET6
case AF_INET6:
- plen = (uint16_t) sizeof(struct sctp_ipv6addr_param);
+ plen = (uint16_t)sizeof(struct sctp_ipv6addr_param);
break;
#endif
default:
@@ -2028,7 +2028,7 @@ struct mbuf *
sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
struct sctp_scoping *scope,
struct mbuf *m_at, int cnt_inits_to,
- uint16_t * padding_len, uint16_t * chunk_len)
+ uint16_t *padding_len, uint16_t *chunk_len)
{
struct sctp_vrf *vrf = NULL;
int cnt, limit_out = 0, total_count;
@@ -2138,8 +2138,10 @@ skip_count:
cnt++;
total_count++;
if (cnt >= 2) {
- /* two from each
- * address */
+ /*
+ * two from each
+ * address
+ */
break;
}
if (total_count > SCTP_ADDRESS_LIMIT) {
@@ -2450,7 +2452,7 @@ sctp_is_addr_in_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa)
static struct sctp_ifa *
sctp_choose_boundspecific_inp(struct sctp_inpcb *inp,
- sctp_route_t * ro,
+ sctp_route_t *ro,
uint32_t vrf_id,
int non_asoc_addr_ok,
uint8_t dest_is_priv,
@@ -2582,7 +2584,7 @@ once_again_too:
static struct sctp_ifa *
sctp_choose_boundspecific_stcb(struct sctp_inpcb *inp,
struct sctp_tcb *stcb,
- sctp_route_t * ro,
+ sctp_route_t *ro,
uint32_t vrf_id,
uint8_t dest_is_priv,
uint8_t dest_is_loop,
@@ -2776,7 +2778,7 @@ sctp_select_nth_preferred_addr_from_ifn_boundall(struct sctp_ifn *ifn,
uint8_t dest_is_priv,
int addr_wanted,
sa_family_t fam,
- sctp_route_t * ro
+ sctp_route_t *ro
)
{
struct sctp_ifa *ifa, *sifa;
@@ -2825,8 +2827,10 @@ sctp_select_nth_preferred_addr_from_ifn_boundall(struct sctp_ifn *ifn,
if (fam == AF_INET6 &&
IN6_IS_ADDR_LINKLOCAL(&sifa->address.sin6.sin6_addr) &&
IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr)) {
- /* link-local <-> link-local must belong to the same
- * scope. */
+ /*
+ * link-local <-> link-local must belong to the same
+ * scope.
+ */
memcpy(&lsa6, &sifa->address.sin6, sizeof(struct sockaddr_in6));
(void)sa6_recoverscope(&lsa6);
if (sin6.sin6_scope_id != lsa6.sin6_scope_id) {
@@ -2947,7 +2951,7 @@ static struct sctp_ifa *
sctp_choose_boundall(struct sctp_inpcb *inp,
struct sctp_tcb *stcb,
struct sctp_nets *net,
- sctp_route_t * ro,
+ sctp_route_t *ro,
uint32_t vrf_id,
uint8_t dest_is_priv,
uint8_t dest_is_loop,
@@ -3300,7 +3304,7 @@ out:
struct sctp_ifa *
sctp_source_address_selection(struct sctp_inpcb *inp,
struct sctp_tcb *stcb,
- sctp_route_t * ro,
+ sctp_route_t *ro,
struct sctp_nets *net,
int non_asoc_addr_ok, uint32_t vrf_id)
{
@@ -3808,7 +3812,7 @@ sctp_findassociation_cmsgs(struct sctp_inpcb **inp_p,
static struct mbuf *
sctp_add_cookie(struct mbuf *init, int init_offset,
- struct mbuf *initack, int initack_offset, struct sctp_state_cookie *stc_in, uint8_t ** signature)
+ struct mbuf *initack, int initack_offset, struct sctp_state_cookie *stc_in, uint8_t **signature)
{
struct mbuf *copy_init, *copy_initack, *m_at, *sig, *mret;
struct sctp_state_cookie *stc;
@@ -3887,7 +3891,7 @@ sctp_add_cookie(struct mbuf *init, int init_offset,
SCTP_BUF_LEN(sig) = 0;
SCTP_BUF_NEXT(m_at) = sig;
sig_offset = 0;
- foo = (uint8_t *) (mtod(sig, caddr_t)+sig_offset);
+ foo = (uint8_t *)(mtod(sig, caddr_t)+sig_offset);
memset(foo, 0, SCTP_SIGNATURE_SIZE);
*signature = foo;
SCTP_BUF_LEN(sig) += SCTP_SIGNATURE_SIZE;
@@ -4100,7 +4104,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
memset(&iproute, 0, sizeof(iproute));
memcpy(&ro->ro_dst, to, to->sa_len);
} else {
- ro = (sctp_route_t *) & net->ro;
+ ro = (sctp_route_t *)&net->ro;
}
/* Now the address selection part */
ip->ip_dst.s_addr = ((struct sockaddr_in *)to)->sin_addr.s_addr;
@@ -4163,7 +4167,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip));
udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port));
udp->uh_dport = port;
- udp->uh_ulen = htons((uint16_t) (packet_length - sizeof(struct ip)));
+ udp->uh_ulen = htons((uint16_t)(packet_length - sizeof(struct ip)));
if (V_udp_cksum) {
udp->uh_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, udp->uh_ulen + htons(IPPROTO_UDP));
} else {
@@ -4201,9 +4205,9 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
memcpy(&iproute, ro, sizeof(*ro));
}
SCTPDBG(SCTP_DEBUG_OUTPUT3, "Calling ipv4 output routine from low level src addr:%x\n",
- (uint32_t) (ntohl(ip->ip_src.s_addr)));
+ (uint32_t)(ntohl(ip->ip_src.s_addr)));
SCTPDBG(SCTP_DEBUG_OUTPUT3, "Destination is %x\n",
- (uint32_t) (ntohl(ip->ip_dst.s_addr)));
+ (uint32_t)(ntohl(ip->ip_dst.s_addr)));
SCTPDBG(SCTP_DEBUG_OUTPUT3, "RTP route is %p through\n",
(void *)ro->ro_rt);
@@ -4264,8 +4268,10 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
/* free tempy routes */
RO_RTFREE(ro);
} else {
- /* PMTU check versus smallest asoc MTU goes
- * here */
+ /*
+ * PMTU check versus smallest asoc MTU goes
+ * here
+ */
if ((ro->ro_rt != NULL) &&
(net->ro._s_addr)) {
uint32_t mtu;
@@ -4357,10 +4363,10 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
}
if (net == NULL) {
memset(&ip6route, 0, sizeof(ip6route));
- ro = (sctp_route_t *) & ip6route;
+ ro = (sctp_route_t *)&ip6route;
memcpy(&ro->ro_dst, sin6, sin6->sin6_len);
} else {
- ro = (sctp_route_t *) & net->ro;
+ ro = (sctp_route_t *)&net->ro;
}
/*
* We assume here that inp_flow is in host byte
@@ -4389,7 +4395,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
} else {
ip6h->ip6_nxt = IPPROTO_SCTP;
}
- ip6h->ip6_plen = (uint16_t) (packet_length - sizeof(struct ip6_hdr));
+ ip6h->ip6_plen = (uint16_t)(packet_length - sizeof(struct ip6_hdr));
ip6h->ip6_dst = sin6->sin6_addr;
/*
@@ -4508,7 +4514,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
udp = (struct udphdr *)((caddr_t)ip6h + sizeof(struct ip6_hdr));
udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port));
udp->uh_dport = port;
- udp->uh_ulen = htons((uint16_t) (packet_length - sizeof(struct ip6_hdr)));
+ udp->uh_ulen = htons((uint16_t)(packet_length - sizeof(struct ip6_hdr)));
udp->uh_sum = 0;
sctphdr = (struct sctphdr *)((caddr_t)udp + sizeof(struct udphdr));
} else {
@@ -4540,8 +4546,10 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT3, (struct sockaddr *)sin6);
if (net) {
sin6 = (struct sockaddr_in6 *)&net->ro._l_addr;
- /* preserve the port and scope for link
- * local send */
+ /*
+ * preserve the port and scope for link
+ * local send
+ */
prev_scope = sin6->sin6_scope_id;
prev_port = sin6->sin6_port;
}
@@ -4607,8 +4615,10 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
/* Now if we had a temp route free it */
RO_RTFREE(ro);
} else {
- /* PMTU check versus smallest asoc MTU goes
- * here */
+ /*
+ * PMTU check versus smallest asoc MTU goes
+ * here
+ */
if (ro->ro_rt == NULL) {
/* Route was freed */
if (net->ro._s_addr &&
@@ -4711,7 +4721,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
SCTPDBG(SCTP_DEBUG_OUTPUT4, "Sending INIT - mbuf?\n");
return;
}
- chunk_len = (uint16_t) sizeof(struct sctp_init_chunk);
+ chunk_len = (uint16_t)sizeof(struct sctp_init_chunk);
padding_len = 0;
/* Now lets put the chunk header in place */
init = mtod(m, struct sctp_init_chunk *);
@@ -4731,7 +4741,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
/* Adaptation layer indication parameter */
if (inp->sctp_ep.adaptation_layer_indicator_provided) {
- parameter_len = (uint16_t) sizeof(struct sctp_adaptation_layer_indication);
+ parameter_len = (uint16_t)sizeof(struct sctp_adaptation_layer_indication);
ali = (struct sctp_adaptation_layer_indication *)(mtod(m, caddr_t)+chunk_len);
ali->ph.param_type = htons(SCTP_ULP_ADAPTATION);
ali->ph.param_length = htons(parameter_len);
@@ -4740,7 +4750,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
}
/* ECN parameter */
if (stcb->asoc.ecn_supported == 1) {
- parameter_len = (uint16_t) sizeof(struct sctp_paramhdr);
+ parameter_len = (uint16_t)sizeof(struct sctp_paramhdr);
ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+chunk_len);
ph->param_type = htons(SCTP_ECN_CAPABLE);
ph->param_length = htons(parameter_len);
@@ -4748,7 +4758,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
}
/* PR-SCTP supported parameter */
if (stcb->asoc.prsctp_supported == 1) {
- parameter_len = (uint16_t) sizeof(struct sctp_paramhdr);
+ parameter_len = (uint16_t)sizeof(struct sctp_paramhdr);
ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+chunk_len);
ph->param_type = htons(SCTP_PRSCTP_SUPPORTED);
ph->param_length = htons(parameter_len);
@@ -4756,7 +4766,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
}
/* Add NAT friendly parameter. */
if (SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly)) {
- parameter_len = (uint16_t) sizeof(struct sctp_paramhdr);
+ parameter_len = (uint16_t)sizeof(struct sctp_paramhdr);
ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+chunk_len);
ph->param_type = htons(SCTP_HAS_NAT_SUPPORT);
ph->param_length = htons(parameter_len);
@@ -4791,7 +4801,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
pr_supported->chunk_types[num_ext++] = SCTP_PACKET_DROPPED;
}
if (num_ext > 0) {
- parameter_len = (uint16_t) sizeof(struct sctp_supported_chunk_types_param) + num_ext;
+ parameter_len = (uint16_t)sizeof(struct sctp_supported_chunk_types_param) + num_ext;
pr_supported->ph.param_type = htons(SCTP_SUPPORTED_CHUNK_EXT);
pr_supported->ph.param_length = htons(parameter_len);
padding_len = SCTP_SIZE32(parameter_len) - parameter_len;
@@ -4809,7 +4819,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
padding_len = 0;
}
randp = (struct sctp_auth_random *)(mtod(m, caddr_t)+chunk_len);
- parameter_len = (uint16_t) sizeof(struct sctp_auth_random) + stcb->asoc.authinfo.random_len;
+ parameter_len = (uint16_t)sizeof(struct sctp_auth_random) + stcb->asoc.authinfo.random_len;
/* random key already contains the header */
memcpy(randp, stcb->asoc.authinfo.random->key, parameter_len);
padding_len = SCTP_SIZE32(parameter_len) - parameter_len;
@@ -4825,11 +4835,11 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
padding_len = 0;
}
hmacs = (struct sctp_auth_hmac_algo *)(mtod(m, caddr_t)+chunk_len);
- parameter_len = (uint16_t) (sizeof(struct sctp_auth_hmac_algo) +
+ parameter_len = (uint16_t)(sizeof(struct sctp_auth_hmac_algo) +
stcb->asoc.local_hmacs->num_algo * sizeof(uint16_t));
hmacs->ph.param_type = htons(SCTP_HMAC_LIST);
hmacs->ph.param_length = htons(parameter_len);
- sctp_serialize_hmaclist(stcb->asoc.local_hmacs, (uint8_t *) hmacs->hmac_ids);
+ sctp_serialize_hmaclist(stcb->asoc.local_hmacs, (uint8_t *)hmacs->hmac_ids);
padding_len = SCTP_SIZE32(parameter_len) - parameter_len;
chunk_len += parameter_len;
}
@@ -4843,7 +4853,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
padding_len = 0;
}
chunks = (struct sctp_auth_chunk_list *)(mtod(m, caddr_t)+chunk_len);
- parameter_len = (uint16_t) (sizeof(struct sctp_auth_chunk_list) +
+ parameter_len = (uint16_t)(sizeof(struct sctp_auth_chunk_list) +
sctp_auth_get_chklist_size(stcb->asoc.local_auth_chunks));
chunks->ph.param_type = htons(SCTP_CHUNK_LIST);
chunks->ph.param_length = htons(parameter_len);
@@ -4861,7 +4871,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
chunk_len += padding_len;
padding_len = 0;
}
- parameter_len = (uint16_t) sizeof(struct sctp_cookie_perserve_param);
+ parameter_len = (uint16_t)sizeof(struct sctp_cookie_perserve_param);
cookie_preserve = (struct sctp_cookie_perserve_param *)(mtod(m, caddr_t)+chunk_len);
cookie_preserve->ph.param_type = htons(SCTP_COOKIE_PRESERVE);
cookie_preserve->ph.param_length = htons(parameter_len);
@@ -4877,12 +4887,12 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
chunk_len += padding_len;
padding_len = 0;
}
- parameter_len = (uint16_t) sizeof(struct sctp_paramhdr);
+ parameter_len = (uint16_t)sizeof(struct sctp_paramhdr);
if (stcb->asoc.scope.ipv4_addr_legal) {
- parameter_len += (uint16_t) sizeof(uint16_t);
+ parameter_len += (uint16_t)sizeof(uint16_t);
}
if (stcb->asoc.scope.ipv6_addr_legal) {
- parameter_len += (uint16_t) sizeof(uint16_t);
+ parameter_len += (uint16_t)sizeof(uint16_t);
}
sup_addr = (struct sctp_supported_addr_param *)(mtod(m, caddr_t)+chunk_len);
sup_addr->ph.param_type = htons(SCTP_SUPPORTED_ADDRTYPE);
@@ -5561,7 +5571,7 @@ do_a_abort:
sctp_m_freem(op_err);
return;
}
- chunk_len = (uint16_t) sizeof(struct sctp_init_ack_chunk);
+ chunk_len = (uint16_t)sizeof(struct sctp_init_ack_chunk);
padding_len = 0;
/*
@@ -5678,8 +5688,10 @@ do_a_abort:
* show up in our scoped count.
*/
cnt_inits_to = 1;
- /* pull out the scope_id from
- * incoming pkt */
+ /*
+ * pull out the scope_id from
+ * incoming pkt
+ */
} else if (IN6_IS_ADDR_SITELOCAL(&src6->sin6_addr) ||
IN6_IS_ADDR_SITELOCAL(&dst6->sin6_addr)) {
/*
@@ -5741,7 +5753,7 @@ do_a_abort:
* did the selection.
*/
net->ro._s_addr = sctp_source_address_selection(inp,
- stcb, (sctp_route_t *) & net->ro,
+ stcb, (sctp_route_t *)&net->ro,
net, 0, vrf_id);
if (net->ro._s_addr == NULL)
return;
@@ -5771,7 +5783,7 @@ do_a_abort:
* done the selection.
*/
net->ro._s_addr = sctp_source_address_selection(inp,
- stcb, (sctp_route_t *) & net->ro,
+ stcb, (sctp_route_t *)&net->ro,
net, 0, vrf_id);
if (net->ro._s_addr == NULL)
return;
@@ -5879,7 +5891,7 @@ do_a_abort:
/* adaptation layer indication parameter */
if (inp->sctp_ep.adaptation_layer_indicator_provided) {
- parameter_len = (uint16_t) sizeof(struct sctp_adaptation_layer_indication);
+ parameter_len = (uint16_t)sizeof(struct sctp_adaptation_layer_indication);
ali = (struct sctp_adaptation_layer_indication *)(mtod(m, caddr_t)+chunk_len);
ali->ph.param_type = htons(SCTP_ULP_ADAPTATION);
ali->ph.param_length = htons(parameter_len);
@@ -5889,7 +5901,7 @@ do_a_abort:
/* ECN parameter */
if (((asoc != NULL) && (asoc->ecn_supported == 1)) ||
((asoc == NULL) && (inp->ecn_supported == 1))) {
- parameter_len = (uint16_t) sizeof(struct sctp_paramhdr);
+ parameter_len = (uint16_t)sizeof(struct sctp_paramhdr);
ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+chunk_len);
ph->param_type = htons(SCTP_ECN_CAPABLE);
ph->param_length = htons(parameter_len);
@@ -5898,7 +5910,7 @@ do_a_abort:
/* PR-SCTP supported parameter */
if (((asoc != NULL) && (asoc->prsctp_supported == 1)) ||
((asoc == NULL) && (inp->prsctp_supported == 1))) {
- parameter_len = (uint16_t) sizeof(struct sctp_paramhdr);
+ parameter_len = (uint16_t)sizeof(struct sctp_paramhdr);
ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+chunk_len);
ph->param_type = htons(SCTP_PRSCTP_SUPPORTED);
ph->param_length = htons(parameter_len);
@@ -5906,7 +5918,7 @@ do_a_abort:
}
/* Add NAT friendly parameter */
if (nat_friendly) {
- parameter_len = (uint16_t) sizeof(struct sctp_paramhdr);
+ parameter_len = (uint16_t)sizeof(struct sctp_paramhdr);
ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+chunk_len);
ph->param_type = htons(SCTP_HAS_NAT_SUPPORT);
ph->param_length = htons(parameter_len);
@@ -5949,7 +5961,7 @@ do_a_abort:
pr_supported->chunk_types[num_ext++] = SCTP_PACKET_DROPPED;
}
if (num_ext > 0) {
- parameter_len = (uint16_t) sizeof(struct sctp_supported_chunk_types_param) + num_ext;
+ parameter_len = (uint16_t)sizeof(struct sctp_supported_chunk_types_param) + num_ext;
pr_supported->ph.param_type = htons(SCTP_SUPPORTED_CHUNK_EXT);
pr_supported->ph.param_length = htons(parameter_len);
padding_len = SCTP_SIZE32(parameter_len) - parameter_len;
@@ -5969,7 +5981,7 @@ do_a_abort:
}
/* generate and add RANDOM parameter */
randp = (struct sctp_auth_random *)(mtod(m, caddr_t)+chunk_len);
- parameter_len = (uint16_t) sizeof(struct sctp_auth_random) +
+ parameter_len = (uint16_t)sizeof(struct sctp_auth_random) +
SCTP_AUTH_RANDOM_SIZE_DEFAULT;
randp->ph.param_type = htons(SCTP_RANDOM);
randp->ph.param_length = htons(parameter_len);
@@ -5984,9 +5996,9 @@ do_a_abort:
}
/* add HMAC_ALGO parameter */
hmacs = (struct sctp_auth_hmac_algo *)(mtod(m, caddr_t)+chunk_len);
- parameter_len = (uint16_t) sizeof(struct sctp_auth_hmac_algo) +
+ parameter_len = (uint16_t)sizeof(struct sctp_auth_hmac_algo) +
sctp_serialize_hmaclist(inp->sctp_ep.local_hmacs,
- (uint8_t *) hmacs->hmac_ids);
+ (uint8_t *)hmacs->hmac_ids);
hmacs->ph.param_type = htons(SCTP_HMAC_LIST);
hmacs->ph.param_length = htons(parameter_len);
padding_len = SCTP_SIZE32(parameter_len) - parameter_len;
@@ -5999,7 +6011,7 @@ do_a_abort:
}
/* add CHUNKS parameter */
chunks = (struct sctp_auth_chunk_list *)(mtod(m, caddr_t)+chunk_len);
- parameter_len = (uint16_t) sizeof(struct sctp_auth_chunk_list) +
+ parameter_len = (uint16_t)sizeof(struct sctp_auth_chunk_list) +
sctp_serialize_auth_chunks(inp->sctp_ep.local_auth_chunks,
chunks->chunk_types);
chunks->ph.param_type = htons(SCTP_CHUNK_LIST);
@@ -6085,9 +6097,9 @@ do_a_abort:
* though thus we set trailer.
*/
(void)sctp_hmac_m(SCTP_HMAC,
- (uint8_t *) inp->sctp_ep.secret_key[(int)(inp->sctp_ep.current_secret_number)],
+ (uint8_t *)inp->sctp_ep.secret_key[(int)(inp->sctp_ep.current_secret_number)],
SCTP_SECRET_SIZE, m_cookie, sizeof(struct sctp_paramhdr),
- (uint8_t *) signature, SCTP_SIGNATURE_SIZE);
+ (uint8_t *)signature, SCTP_SIGNATURE_SIZE);
/*
* We sifa 0 here to NOT set IP_DF if its IPv4, we ignore the return
* here since the timer will drive a retranmission.
@@ -6165,9 +6177,9 @@ sctp_prune_prsctp(struct sctp_tcb *stcb,
if (freed_spc >= dataout) {
return;
}
- } /* if chunk was present */
- } /* if of sufficient priority */
- } /* if chunk has enabled */
+ } /* if chunk was present */
+ } /* if of sufficient priority */
+ } /* if chunk has enabled */
} /* tailqforeach */
TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) {
@@ -6188,11 +6200,11 @@ sctp_prune_prsctp(struct sctp_tcb *stcb,
if (freed_spc >= dataout) {
return;
}
- } /* end if chk->data */
- } /* end if right class */
- } /* end if chk pr-sctp */
+ } /* end if chk->data */
+ } /* end if right class */
+ } /* end if chk pr-sctp */
} /* tailqforeachsafe (chk) */
- } /* if enabled in asoc */
+ } /* if enabled in asoc */
}
int
@@ -6435,8 +6447,10 @@ error_out:
/* get the prepend space */
SCTP_BUF_RESV_UF(outchain, (SCTP_FIRST_MBUF_RESV + 4));
} else {
- /* We really should not get a NULL
- * in endofchain */
+ /*
+ * We really should not get a NULL
+ * in endofchain
+ */
/* find end */
m = outchain;
while (m) {
@@ -6448,8 +6462,10 @@ error_out:
}
/* sanity */
if (*endofchain == NULL) {
- /* huh, TSNH XXX maybe we
- * should panic */
+ /*
+ * huh, TSNH XXX maybe we
+ * should panic
+ */
sctp_m_freem(outchain);
goto new_mbuf;
}
@@ -6612,7 +6628,7 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr,
ph = mtod(m, struct sctp_paramhdr *);
ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT);
- ph->param_length = htons((uint16_t) (sizeof(struct sctp_paramhdr) + ca->sndlen));
+ ph->param_length = htons((uint16_t)(sizeof(struct sctp_paramhdr) + ca->sndlen));
}
/*
* We add one here to keep the assoc from dis-appearing on
@@ -6648,13 +6664,17 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr,
if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) {
goto abort_anyway;
}
- /* there is nothing queued to send, so I'm
- * done... */
+ /*
+ * there is nothing queued to send, so I'm
+ * done...
+ */
if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) &&
(SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) &&
(SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) {
- /* only send SHUTDOWN the first time
- * through */
+ /*
+ * only send SHUTDOWN the first time
+ * through
+ */
if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) {
SCTP_STAT_DECR_GAUGE32(sctps_currestab);
}
@@ -6977,7 +6997,7 @@ all_done:
sctp_misc_ints(SCTP_FLIGHT_LOG_UP,
data_list[i]->whoTo->flight_size,
data_list[i]->book_size,
- (uint32_t) (uintptr_t) data_list[i]->whoTo,
+ (uint32_t)(uintptr_t)data_list[i]->whoTo,
data_list[i]->rec.data.tsn);
}
sctp_flight_size_increase(data_list[i]);
@@ -6987,7 +7007,7 @@ all_done:
asoc->peers_rwnd, data_list[i]->send_size, SCTP_BASE_SYSCTL(sctp_peer_chunk_oh));
}
asoc->peers_rwnd = sctp_sbspace_sub(asoc->peers_rwnd,
- (uint32_t) (data_list[i]->send_size + SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)));
+ (uint32_t)(data_list[i]->send_size + SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)));
if (asoc->peers_rwnd < stcb->sctp_ep->sctp_ep.sctp_sws_sender) {
/* SWS sender side engages */
asoc->peers_rwnd = 0;
@@ -7285,8 +7305,10 @@ re_look:
SCTP_TCB_SEND_LOCK(stcb);
send_lock_up = 1;
if (sp->msg_is_complete) {
- /* the sender finished the
- * msg */
+ /*
+ * the sender finished the
+ * msg
+ */
goto re_look;
}
}
@@ -7478,10 +7500,10 @@ dont_do_it:
}
if (stcb->asoc.idata_supported == 0) {
sctp_snd_sb_alloc(stcb, sizeof(struct sctp_data_chunk));
- chk->book_size = chk->send_size = (uint16_t) (to_move + sizeof(struct sctp_data_chunk));
+ chk->book_size = chk->send_size = (uint16_t)(to_move + sizeof(struct sctp_data_chunk));
} else {
sctp_snd_sb_alloc(stcb, sizeof(struct sctp_idata_chunk));
- chk->book_size = chk->send_size = (uint16_t) (to_move + sizeof(struct sctp_idata_chunk));
+ chk->book_size = chk->send_size = (uint16_t)(to_move + sizeof(struct sctp_idata_chunk));
}
chk->book_size_scale = 0;
chk->sent = SCTP_DATAGRAM_UNSENT;
@@ -7535,8 +7557,8 @@ dont_do_it:
chk->rec.data.tsn = atomic_fetchadd_int(&asoc->sending_seq, 1);
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_AT_SEND_2_OUTQ) {
sctp_misc_ints(SCTP_STRMOUT_LOG_SEND,
- (uint32_t) (uintptr_t) stcb, sp->length,
- (uint32_t) ((chk->rec.data.sid << 16) | (0x0000ffff & chk->rec.data.mid)),
+ (uint32_t)(uintptr_t)stcb, sp->length,
+ (uint32_t)((chk->rec.data.sid << 16) | (0x0000ffff & chk->rec.data.mid)),
chk->rec.data.tsn);
}
if (stcb->asoc.idata_supported == 0) {
@@ -7570,7 +7592,7 @@ dont_do_it:
dchkh->ch.chunk_flags = chk->rec.data.rcv_flags;
dchkh->dp.tsn = htonl(chk->rec.data.tsn);
dchkh->dp.sid = htons(strq->sid);
- dchkh->dp.ssn = htons((uint16_t) chk->rec.data.mid);
+ dchkh->dp.ssn = htons((uint16_t)chk->rec.data.mid);
dchkh->dp.ppid = chk->rec.data.ppid;
dchkh->ch.chunk_length = htons(chk->send_size);
} else {
@@ -8175,8 +8197,10 @@ again_one_more_time:
net->port, NULL,
0, 0,
so_locked))) {
- /* error, we could not
- * output */
+ /*
+ * error, we could not
+ * output
+ */
SCTPDBG(SCTP_DEBUG_OUTPUT3, "Gak send error %d\n", error);
if (from_where == 0) {
SCTP_STAT_INCR(sctps_lowlevelerrusr);
@@ -8249,12 +8273,16 @@ again_one_more_time:
* to where the sack is going..
*/
if (chk->whoTo == net) {
- /* Don't transmit it to where its
- * going (current net) */
+ /*
+ * Don't transmit it to where its
+ * going (current net)
+ */
continue;
} else if (sack_goes_to == net) {
- /* But do transmit it to this
- * address */
+ /*
+ * But do transmit it to this
+ * address
+ */
goto skip_net_check;
}
}
@@ -8447,8 +8475,10 @@ again_one_more_time:
net->port, NULL,
0, 0,
so_locked))) {
- /* error, we could not
- * output */
+ /*
+ * error, we could not
+ * output
+ */
SCTPDBG(SCTP_DEBUG_OUTPUT3, "Gak send error %d\n", error);
if (from_where == 0) {
SCTP_STAT_INCR(sctps_lowlevelerrusr);
@@ -8645,13 +8675,17 @@ again_one_more_time:
override_ok = 0;
SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks);
} else if (override_ok) {
- /* use this data's
- * keyid */
+ /*
+ * use this data's
+ * keyid
+ */
auth_keyid = chk->auth_keyid;
override_ok = 0;
} else if (auth_keyid != chk->auth_keyid) {
- /* different keyid,
- * so done bundling */
+ /*
+ * different keyid,
+ * so done bundling
+ */
break;
}
}
@@ -8730,7 +8764,8 @@ again_one_more_time:
break;
}
} /* for (chunk gather loop for this net) */
-} /* if asoc.state OPEN */ no_data_fill:
+ } /* if asoc.state OPEN */
+no_data_fill:
/* Is there something to send for this destination? */
if (outchain) {
/* We may need to start a control timer or two */
@@ -8910,7 +8945,7 @@ sctp_queue_op_err(struct sctp_tcb *stcb, struct mbuf *op_err)
return;
}
chk->copy_by_ref = 0;
- chk->send_size = (uint16_t) chunk_length;
+ chk->send_size = (uint16_t)chunk_length;
chk->sent = SCTP_DATAGRAM_UNSENT;
chk->snd_count = 0;
chk->asoc = &stcb->asoc;
@@ -9691,8 +9726,10 @@ one_chunk_around:
auth_keyid = fwd->auth_keyid;
override_ok = 0;
} else if (fwd->auth_keyid != auth_keyid) {
- /* different keyid,
- * so done bundling */
+ /*
+ * different keyid,
+ * so done bundling
+ */
break;
}
}
@@ -9814,14 +9851,14 @@ one_chunk_around:
asoc->peers_rwnd, data_list[i]->send_size, SCTP_BASE_SYSCTL(sctp_peer_chunk_oh));
}
asoc->peers_rwnd = sctp_sbspace_sub(asoc->peers_rwnd,
- (uint32_t) (data_list[i]->send_size +
+ (uint32_t)(data_list[i]->send_size +
SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)));
}
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) {
sctp_misc_ints(SCTP_FLIGHT_LOG_UP_RSND,
data_list[i]->whoTo->flight_size,
data_list[i]->book_size,
- (uint32_t) (uintptr_t) data_list[i]->whoTo,
+ (uint32_t)(uintptr_t)data_list[i]->whoTo,
data_list[i]->rec.data.tsn);
}
sctp_flight_size_increase(data_list[i]);
@@ -10068,9 +10105,11 @@ do_it_again:
if (asoc->max_burst > 0) {
if (SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst)) {
if ((net->flight_size + (asoc->max_burst * net->mtu)) < net->cwnd) {
- /* JRS - Use the congestion
+ /*
+ * JRS - Use the congestion
* control given in the
- * congestion control module */
+ * congestion control module
+ */
asoc->cc_functions.sctp_cwnd_update_after_output(stcb, net, asoc->max_burst);
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_MAXBURST_ENABLE) {
sctp_log_maxburst(stcb, net, 0, asoc->max_burst, SCTP_MAX_BURST_APPLIED);
@@ -10080,8 +10119,10 @@ do_it_again:
net->fast_retran_ip = 0;
} else {
if (net->flight_size == 0) {
- /* Should be decaying the
- * cwnd here */
+ /*
+ * Should be decaying the
+ * cwnd here
+ */
;
}
}
@@ -10411,7 +10452,7 @@ sctp_fill_in_rest:
strseq_m++;
} else {
strseq->sid = htons(at->rec.data.sid);
- strseq->ssn = htons((uint16_t) at->rec.data.mid);
+ strseq->ssn = htons((uint16_t)at->rec.data.mid);
strseq++;
}
i++;
@@ -10766,7 +10807,7 @@ sctp_send_sack(struct sctp_tcb *stcb, int so_locked
}
/* now we must add any dups we are going to report. */
if ((limit_reached == 0) && (asoc->numduptsns)) {
- dup = (uint32_t *) gap_descriptor;
+ dup = (uint32_t *)gap_descriptor;
for (i = 0; i < asoc->numduptsns; i++) {
*dup = htonl(asoc->dup_tsns[i]);
dup++;
@@ -10783,7 +10824,7 @@ sctp_send_sack(struct sctp_tcb *stcb, int so_locked
* queue.
*/
if (type == SCTP_SELECTIVE_ACK) {
- a_chk->send_size = (uint16_t) (sizeof(struct sctp_sack_chunk) +
+ a_chk->send_size = (uint16_t)(sizeof(struct sctp_sack_chunk) +
(num_gap_blocks + num_nr_gap_blocks) * sizeof(struct sctp_gap_ack_block) +
num_dups * sizeof(int32_t));
SCTP_BUF_LEN(a_chk->data) = a_chk->send_size;
@@ -10795,7 +10836,7 @@ sctp_send_sack(struct sctp_tcb *stcb, int so_locked
sack->ch.chunk_flags = flags;
sack->ch.chunk_length = htons(a_chk->send_size);
} else {
- a_chk->send_size = (uint16_t) (sizeof(struct sctp_nr_sack_chunk) +
+ a_chk->send_size = (uint16_t)(sizeof(struct sctp_nr_sack_chunk) +
(num_gap_blocks + num_nr_gap_blocks) * sizeof(struct sctp_gap_ack_block) +
num_dups * sizeof(int32_t));
SCTP_BUF_LEN(a_chk->data) = a_chk->send_size;
@@ -10861,13 +10902,13 @@ sctp_send_abort_tcb(struct sctp_tcb *stcb, struct mbuf *operr, int so_locked
cause_len = 0;
m_last = NULL;
for (m = operr; m; m = SCTP_BUF_NEXT(m)) {
- cause_len += (uint16_t) SCTP_BUF_LEN(m);
+ cause_len += (uint16_t)SCTP_BUF_LEN(m);
if (SCTP_BUF_NEXT(m) == NULL) {
m_last = m;
}
}
SCTP_BUF_LEN(m_abort) = sizeof(struct sctp_abort_chunk);
- chunk_len = (uint16_t) sizeof(struct sctp_abort_chunk) + cause_len;
+ chunk_len = (uint16_t)sizeof(struct sctp_abort_chunk) + cause_len;
padding_len = SCTP_SIZE32(chunk_len) - chunk_len;
if (m_out == NULL) {
/* NO Auth chunk prepended, so reserve space in front */
@@ -11100,7 +11141,7 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst,
udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port));
udp->uh_dport = port;
udp->uh_sum = 0;
- udp->uh_ulen = htons((uint16_t) (sizeof(struct udphdr) +
+ udp->uh_ulen = htons((uint16_t)(sizeof(struct udphdr) +
sizeof(struct sctphdr) +
sizeof(struct sctp_chunkhdr) +
cause_len + padding_len));
@@ -11126,7 +11167,7 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst,
} else {
ch->chunk_flags = SCTP_HAD_NO_TCB;
}
- ch->chunk_length = htons((uint16_t) (sizeof(struct sctp_chunkhdr) + cause_len));
+ ch->chunk_length = htons((uint16_t)(sizeof(struct sctp_chunkhdr) + cause_len));
len += sizeof(struct sctp_chunkhdr);
len += cause_len + padding_len;
@@ -11175,7 +11216,7 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst,
#endif
#ifdef INET6
case AF_INET6:
- ip6->ip6_plen = (uint16_t) (len - sizeof(struct ip6_hdr));
+ ip6->ip6_plen = (uint16_t)(len - sizeof(struct ip6_hdr));
if (port) {
#if defined(SCTP_WITH_NO_CSUM)
SCTP_STAT_INCR(sctps_sendnocrc);
@@ -11291,7 +11332,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 = (uint8_t) 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) {
/*
@@ -11442,7 +11483,7 @@ sctp_send_packet_dropped(struct sctp_tcb *stcb, struct sctp_nets *net,
/* Validate that we do not have an ABORT in here. */
offset = iphlen + sizeof(struct sctphdr);
ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset,
- sizeof(*ch), (uint8_t *) & chunk_buf);
+ sizeof(*ch), (uint8_t *)&chunk_buf);
while (ch != NULL) {
chk_length = ntohs(ch->chunk_length);
if (chk_length < sizeof(*ch)) {
@@ -11466,7 +11507,7 @@ sctp_send_packet_dropped(struct sctp_tcb *stcb, struct sctp_nets *net,
}
offset += SCTP_SIZE32(chk_length);
ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset,
- sizeof(*ch), (uint8_t *) & chunk_buf);
+ sizeof(*ch), (uint8_t *)&chunk_buf);
}
if ((len + SCTP_MAX_OVERHEAD + sizeof(struct sctp_pktdrop_chunk)) >
@@ -11502,7 +11543,7 @@ jump_out:
* Len is already adjusted to size minus overhead above take
* out the pkt_drop chunk itself from it.
*/
- chk->send_size = (uint16_t) (len - sizeof(struct sctp_pktdrop_chunk));
+ chk->send_size = (uint16_t)(len - sizeof(struct sctp_pktdrop_chunk));
len = chk->send_size;
} else {
/* no truncation needed */
@@ -11563,8 +11604,10 @@ sctp_send_cwr(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t high_tsn, u
asoc = &stcb->asoc;
TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) {
if ((chk->rec.chunk_id.id == SCTP_ECN_CWR) && (net == chk->whoTo)) {
- /* found a previous CWR queued to same destination
- * update it if needed */
+ /*
+ * found a previous CWR queued to same destination
+ * update it if needed
+ */
uint32_t ctsn;
cwr = mtod(chk->data, struct sctp_cwr_chunk *);
@@ -11640,7 +11683,7 @@ sctp_add_stream_reset_out(struct sctp_tcb *stcb, struct sctp_tmit_chunk *chk,
if (number_entries > SCTP_MAX_STREAMS_AT_ONCE_RESET) {
number_entries = SCTP_MAX_STREAMS_AT_ONCE_RESET;
}
- len = (uint16_t) (sizeof(struct sctp_stream_reset_out_request) + (sizeof(uint16_t) * number_entries));
+ len = (uint16_t)(sizeof(struct sctp_stream_reset_out_request) + (sizeof(uint16_t) * number_entries));
req_out->ph.param_type = htons(SCTP_STR_RESET_OUT_REQUEST);
req_out->ph.param_length = htons(len);
req_out->request_seq = htonl(seq);
@@ -11684,7 +11727,7 @@ sctp_add_stream_reset_out(struct sctp_tcb *stcb, struct sctp_tmit_chunk *chk,
static void
sctp_add_stream_reset_in(struct sctp_tmit_chunk *chk,
- int number_entries, uint16_t * list,
+ int number_entries, uint16_t *list,
uint32_t seq)
{
uint16_t len, old_len, i;
@@ -11697,7 +11740,7 @@ sctp_add_stream_reset_in(struct sctp_tmit_chunk *chk,
/* get to new offset for the param. */
req_in = (struct sctp_stream_reset_in_request *)((caddr_t)ch + len);
/* now how long will this param be? */
- len = (uint16_t) (sizeof(struct sctp_stream_reset_in_request) + (sizeof(uint16_t) * number_entries));
+ len = (uint16_t)(sizeof(struct sctp_stream_reset_in_request) + (sizeof(uint16_t) * number_entries));
req_in->ph.param_type = htons(SCTP_STR_RESET_IN_REQUEST);
req_in->ph.param_length = htons(len);
req_in->request_seq = htonl(seq);
@@ -12013,7 +12056,7 @@ sctp_send_stream_reset_out_if_possible(struct sctp_tcb *stcb, int so_locked)
int
sctp_send_str_reset_req(struct sctp_tcb *stcb,
- uint16_t number_entries, uint16_t * list,
+ uint16_t number_entries, uint16_t *list,
uint8_t send_in_req,
uint8_t send_tsn_req,
uint8_t add_stream,
@@ -12141,8 +12184,10 @@ sctp_send_str_reset_req(struct sctp_tcb *stcb,
stcb->asoc.strmout[i].sid = i;
stcb->asoc.strmout[i].state = oldstream[i].state;
/* FIX ME FIX ME */
- /* This should be a SS_COPY operation FIX ME STREAM
- * SCHEDULER EXPERT */
+ /*
+ * This should be a SS_COPY operation FIX ME STREAM
+ * SCHEDULER EXPERT
+ */
stcb->asoc.ss_functions.sctp_ss_init_stream(stcb, &stcb->asoc.strmout[i], &oldstream[i]);
/* now anything on those queues? */
TAILQ_FOREACH_SAFE(sp, &oldstream[i].outqueue, next, nsp) {
@@ -12246,7 +12291,7 @@ sctp_copy_resume(struct uio *uio,
int max_send_len,
int user_marks_eor,
int *error,
- uint32_t * sndout,
+ uint32_t *sndout,
struct mbuf **new_tail)
{
struct mbuf *m;
@@ -12327,8 +12372,8 @@ sctp_copy_it_in(struct sctp_tcb *stcb,
(void)SCTP_GETTIME_TIMEVAL(&sp->ts);
sp->sid = srcv->sinfo_stream;
- sp->length = (uint32_t) min(uio->uio_resid, max_send_len);
- if ((sp->length == (uint32_t) uio->uio_resid) &&
+ sp->length = (uint32_t)min(uio->uio_resid, max_send_len);
+ if ((sp->length == (uint32_t)uio->uio_resid) &&
((user_marks_eor == 0) ||
(srcv->sinfo_flags & SCTP_EOF) ||
(user_marks_eor && (srcv->sinfo_flags & SCTP_EOR)))) {
@@ -12672,8 +12717,10 @@ sctp_lower_sosend(struct socket *so,
}
if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) {
stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED;
- /* Set the connected flag so we can queue
- * data */
+ /*
+ * Set the connected flag so we can queue
+ * data
+ */
soisconnecting(so);
}
hold_tcblock = 1;
@@ -12683,8 +12730,10 @@ sctp_lower_sosend(struct socket *so,
} else {
SCTP_PRINTF("Huh-3? create lock should have been on??\n");
}
- /* Turn on queue only flag to prevent data from
- * being sent */
+ /*
+ * Turn on queue only flag to prevent data from
+ * being sent
+ */
queue_only = 1;
asoc = &stcb->asoc;
SCTP_SET_STATE(asoc, SCTP_STATE_COOKIE_WAIT);
@@ -12882,7 +12931,7 @@ sctp_lower_sosend(struct socket *so,
/* now move forward the data pointer */
ph = mtod(mm, struct sctp_paramhdr *);
ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT);
- ph->param_length = htons((uint16_t) (sizeof(struct sctp_paramhdr) + tot_out));
+ ph->param_length = htons((uint16_t)(sizeof(struct sctp_paramhdr) + tot_out));
ph++;
SCTP_BUF_LEN(mm) = tot_out + sizeof(struct sctp_paramhdr);
if (top == NULL) {
@@ -13177,8 +13226,10 @@ skip_preblock:
}
/* PR-SCTP? */
if ((asoc->prsctp_supported) && (asoc->sent_queue_cnt_removeable > 0)) {
- /* This is ugly but we must assure locking
- * order */
+ /*
+ * This is ugly but we must assure locking
+ * order
+ */
if (hold_tcblock == 0) {
SCTP_TCB_LOCK(stcb);
hold_tcblock = 1;
@@ -13455,8 +13506,10 @@ dataless_eof:
msg);
sctp_abort_an_association(stcb->sctp_ep, stcb,
op_err, SCTP_SO_LOCKED);
- /* now relock the stcb so everything
- * is sane */
+ /*
+ * now relock the stcb so everything
+ * is sane
+ */
hold_tcblock = 0;
stcb = NULL;
goto out;
@@ -13530,8 +13583,10 @@ skip_out_eof:
if ((queue_only == 0) && (nagle_applies == 0) && (stcb->asoc.peers_rwnd && un_sent)) {
/* we can attempt to send too. */
if (hold_tcblock == 0) {
- /* If there is activity recv'ing sacks no need to
- * send */
+ /*
+ * If there is activity recv'ing sacks no need to
+ * send
+ */
if (SCTP_TCB_TRYLOCK(stcb)) {
sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_USR_SEND, SCTP_SO_LOCKED);
hold_tcblock = 1;
@@ -13605,7 +13660,7 @@ out_unlocked:
*/
struct mbuf *
sctp_add_auth_chunk(struct mbuf *m, struct mbuf **m_end,
- struct sctp_auth_chunk **auth_ret, uint32_t * offset,
+ struct sctp_auth_chunk **auth_ret, uint32_t *offset,
struct sctp_tcb *stcb, uint8_t chunk)
{
struct mbuf *m_auth;
@@ -13660,7 +13715,7 @@ sctp_add_auth_chunk(struct mbuf *m, struct mbuf **m_end,
#ifdef INET6
int
-sctp_v6src_match_nexthop(struct sockaddr_in6 *src6, sctp_route_t * ro)
+sctp_v6src_match_nexthop(struct sockaddr_in6 *src6, sctp_route_t *ro)
{
struct nd_prefix *pfx = NULL;
struct nd_pfxrouter *pfxrtr = NULL;
@@ -13709,7 +13764,7 @@ sctp_v6src_match_nexthop(struct sockaddr_in6 *src6, sctp_route_t * ro)
#endif
int
-sctp_v4src_match_nexthop(struct sctp_ifa *sifa, sctp_route_t * ro)
+sctp_v4src_match_nexthop(struct sctp_ifa *sifa, sctp_route_t *ro)
{
#ifdef INET
struct sockaddr_in *sin, *mask;
OpenPOWER on IntegriCloud