aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/sctp_output.c
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2018-06-14 21:22:14 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2018-06-14 21:22:14 +0000
commit8d86bd564f8e12dbc0e16ef216bc8f6223e174d5 (patch)
tree8360974075b8172ffb392695f67166766a1ba4c9 /sys/netinet/sctp_output.c
parent203c00b359f74408fd5b407334eb47feb2b9c566 (diff)
downloadsrc-8d86bd564f8e12dbc0e16ef216bc8f6223e174d5.tar.gz
src-8d86bd564f8e12dbc0e16ef216bc8f6223e174d5.zip
Whitespace changes.
Notes
Notes: svn path=/head/; revision=335176
Diffstat (limited to 'sys/netinet/sctp_output.c')
-rw-r--r--sys/netinet/sctp_output.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index 31d9304a7ef5..d8c996df517a 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -2545,6 +2545,7 @@ once_again:
inp->next_addr_touse = NULL;
goto once_again;
}
+
inp->next_addr_touse = starting_point;
resettotop = 0;
once_again_too:
@@ -2552,6 +2553,7 @@ once_again_too:
inp->next_addr_touse = LIST_FIRST(&inp->sctp_addr_list);
resettotop = 1;
}
+
/* ok, what about an acceptable address in the inp */
for (laddr = inp->next_addr_touse; laddr;
laddr = LIST_NEXT(laddr, sctp_nxt_addr)) {
@@ -2574,6 +2576,7 @@ once_again_too:
inp->next_addr_touse = NULL;
goto once_again_too;
}
+
/*
* no address bound can be a source for the destination we are in
* trouble
@@ -3988,8 +3991,8 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
int so_locked
#endif
)
-/* nofragment_flag to tell if IP_DF should be set (IPv4 only) */
{
+/* nofragment_flag to tell if IP_DF should be set (IPv4 only) */
/**
* Given a mbuf chain (via SCTP_BUF_NEXT()) that holds a packet header
* WITH an SCTPHDR but no IP header, endpoint inp and sa structure:
@@ -4036,6 +4039,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
if ((auth != NULL) && (stcb != NULL)) {
sctp_fill_hmac_digest_m(m, auth_offset, auth, stcb, auth_keyid);
}
+
if (net) {
tos_value = net->dscp;
} else if (stcb) {
@@ -4550,6 +4554,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
prev_scope = sin6->sin6_scope_id;
prev_port = sin6->sin6_port;
}
+
if (SCTP_GET_HEADER_FOR_OUTPUT(o_pak)) {
/* failed to prepend data, give up */
sctp_m_freem(m);
@@ -4738,6 +4743,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
ali->indication = htonl(inp->sctp_ep.adaptation_layer_indicator);
chunk_len += parameter_len;
}
+
/* ECN parameter */
if (stcb->asoc.ecn_supported == 1) {
parameter_len = (uint16_t)sizeof(struct sctp_paramhdr);
@@ -4746,6 +4752,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
ph->param_length = htons(parameter_len);
chunk_len += parameter_len;
}
+
/* PR-SCTP supported parameter */
if (stcb->asoc.prsctp_supported == 1) {
parameter_len = (uint16_t)sizeof(struct sctp_paramhdr);
@@ -4754,6 +4761,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
ph->param_length = htons(parameter_len);
chunk_len += parameter_len;
}
+
/* Add NAT friendly parameter. */
if (SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly)) {
parameter_len = (uint16_t)sizeof(struct sctp_paramhdr);
@@ -4762,6 +4770,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
ph->param_length = htons(parameter_len);
chunk_len += parameter_len;
}
+
/* And now tell the peer which extensions we support */
num_ext = 0;
pr_supported = (struct sctp_supported_chunk_types_param *)(mtod(m, caddr_t)+chunk_len);
@@ -4852,6 +4861,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
chunk_len += parameter_len;
}
}
+
/* now any cookie time extensions */
if (stcb->asoc.cookie_preserve_req) {
struct sctp_cookie_perserve_param *cookie_preserve;
@@ -4869,6 +4879,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
stcb->asoc.cookie_preserve_req = 0;
chunk_len += parameter_len;
}
+
if (stcb->asoc.scope.ipv4_addr_legal || stcb->asoc.scope.ipv6_addr_legal) {
uint8_t i;
@@ -4897,6 +4908,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
padding_len = 4 - 2 * i;
chunk_len += parameter_len;
}
+
SCTP_BUF_LEN(m) = chunk_len;
/* now the addresses */
/*
@@ -5902,6 +5914,7 @@ do_a_abort:
ali->indication = htonl(inp->sctp_ep.adaptation_layer_indicator);
chunk_len += parameter_len;
}
+
/* ECN parameter */
if (((asoc != NULL) && (asoc->ecn_supported == 1)) ||
((asoc == NULL) && (inp->ecn_supported == 1))) {
@@ -5911,6 +5924,7 @@ do_a_abort:
ph->param_length = htons(parameter_len);
chunk_len += parameter_len;
}
+
/* PR-SCTP supported parameter */
if (((asoc != NULL) && (asoc->prsctp_supported == 1)) ||
((asoc == NULL) && (inp->prsctp_supported == 1))) {
@@ -5920,6 +5934,7 @@ do_a_abort:
ph->param_length = htons(parameter_len);
chunk_len += parameter_len;
}
+
/* Add NAT friendly parameter */
if (nat_friendly) {
parameter_len = (uint16_t)sizeof(struct sctp_paramhdr);
@@ -5928,6 +5943,7 @@ do_a_abort:
ph->param_length = htons(parameter_len);
chunk_len += parameter_len;
}
+
/* And now tell the peer which extensions we support */
num_ext = 0;
pr_supported = (struct sctp_supported_chunk_types_param *)(mtod(m, caddr_t)+chunk_len);
@@ -5971,6 +5987,7 @@ do_a_abort:
padding_len = SCTP_SIZE32(parameter_len) - parameter_len;
chunk_len += parameter_len;
}
+
/* add authentication parameters */
if (((asoc != NULL) && (asoc->auth_supported == 1)) ||
((asoc == NULL) && (inp->auth_supported == 1))) {
@@ -6048,6 +6065,7 @@ do_a_abort:
SCTP_BUF_LEN(m) += padding_len;
padding_len = 0;
}
+
/* tack on the operational error if present */
if (op_err) {
parameter_len = 0;
@@ -7431,6 +7449,7 @@ dont_do_it:
chk->last_mbuf = SCTP_BUF_NEXT(chk->last_mbuf);
}
}
+
if (to_move > length) {
/*- This should not happen either
* since we always lower to_move to the size
@@ -7968,6 +7987,7 @@ nothing_to_send:
*reason_code = 8;
return (0);
}
+
if (asoc->sctp_cmt_on_off > 0) {
/* get the last start point */
start_at = asoc->last_net_cmt_send_started;
@@ -8614,6 +8634,7 @@ again_one_more_time:
/* Don't send the chunk on this net */
continue;
}
+
if (asoc->sctp_cmt_on_off == 0) {
if ((asoc->alternate) &&
(asoc->alternate != net) &&
@@ -8877,6 +8898,7 @@ no_data_fill:
if (old_start_at)
goto again_one_more_time;
}
+
/*
* At the end there should be no NON timed chunks hanging on this
* queue.
@@ -9270,17 +9292,20 @@ sctp_send_asconf(struct sctp_tcb *stcb, struct sctp_nets *net, int addr_locked)
/* can't send a new one if there is one in flight already */
return;
}
+
/* compose an ASCONF chunk, maximum length is PMTU */
m_asconf = sctp_compose_asconf(stcb, &len, addr_locked);
if (m_asconf == NULL) {
return;
}
+
sctp_alloc_a_chunk(stcb, chk);
if (chk == NULL) {
/* no memory */
sctp_m_freem(m_asconf);
return;
}
+
chk->copy_by_ref = 0;
chk->rec.chunk_id.id = SCTP_ASCONF;
chk->rec.chunk_id.can_take_data = 0;
@@ -9351,6 +9376,7 @@ sctp_send_asconf_ack(struct sctp_tcb *stcb)
if (ack->data == NULL) {
continue;
}
+
/* copy the asconf_ack */
m_ack = SCTP_M_COPYM(ack->data, 0, M_COPYALL, M_NOWAIT);
if (m_ack == NULL) {
@@ -10239,6 +10265,7 @@ sctp_output(
SCTP_LTRACE_ERR_RET_PKT(m, inp, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL);
return (EINVAL);
}
+
if (inp->sctp_socket == NULL) {
SCTP_LTRACE_ERR_RET_PKT(m, inp, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL);
return (EINVAL);
@@ -11312,6 +11339,7 @@ sctp_send_hb(struct sctp_tcb *stcb, struct sctp_nets *net, int so_locked
SCTPDBG(SCTP_DEBUG_OUTPUT4, "Gak, can't get a chunk for hb\n");
return;
}
+
chk->copy_by_ref = 0;
chk->rec.chunk_id.id = SCTP_HEARTBEAT_REQUEST;
chk->rec.chunk_id.can_take_data = 1;
@@ -12330,6 +12358,7 @@ sctp_copy_one(struct sctp_stream_queue_pending *sp,
SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, ENOBUFS);
return (ENOBUFS);
}
+
sp->tail_mbuf = m_last(sp->data);
return (0);
}
@@ -12346,6 +12375,7 @@ sctp_copy_it_in(struct sctp_tcb *stcb,
int user_marks_eor,
int *error)
{
+
/*-
* This routine must be very careful in its work. Protocol
* processing is up and running so care must be taken to spl...()
@@ -13010,6 +13040,7 @@ sctp_lower_sosend(struct socket *so,
error = EFAULT;
goto out_unlocked;
}
+
/* Unless E_EOR mode is on, we must make a send FIT in one call. */
if ((user_marks_eor == 0) &&
(sndlen > SCTP_SB_LIMIT_SND(stcb->sctp_socket))) {
@@ -13027,6 +13058,7 @@ sctp_lower_sosend(struct socket *so,
error = EINVAL;
goto out_unlocked;
}
+
if (user_marks_eor) {
local_add_more = min(SCTP_SB_LIMIT_SND(so), SCTP_BASE_SYSCTL(sctp_add_more_threshold));
} else {
@@ -13091,6 +13123,7 @@ sctp_lower_sosend(struct socket *so,
}
SOCKBUF_UNLOCK(&so->so_snd);
}
+
skip_preblock:
if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) {
goto out_unlocked;
@@ -13227,6 +13260,7 @@ skip_preblock:
if (srcv->sinfo_flags & SCTP_SACK_IMMEDIATELY) {
sp->sinfo_flags |= SCTP_SACK_IMMEDIATELY;
}
+
/* Did we reach EOR? */
if ((uio->uio_resid == 0) &&
((user_marks_eor == 0) ||
@@ -13392,6 +13426,7 @@ skip_preblock:
SOCKBUF_UNLOCK(&so->so_snd);
goto out_unlocked;
}
+
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_BLK_LOGGING_ENABLE) {
sctp_log_block(SCTP_BLOCK_LOG_OUTOF_BLK,
asoc, stcb->asoc.total_output_queue_size);
@@ -13757,6 +13792,7 @@ sctp_v6src_match_nexthop(struct sockaddr_in6 *src6, sctp_route_t *ro)
SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, (struct sockaddr *)src6);
return (0);
}
+
SCTPDBG(SCTP_DEBUG_OUTPUT2, "v6src_match_nexthop(), Prefix entry is ");
SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, (struct sockaddr *)src6);