svn commit: r347154 - in stable/11/sys: netinet netinet6
Michael Tuexen
tuexen at FreeBSD.org
Sun May 5 12:28:43 UTC 2019
Author: tuexen
Date: Sun May 5 12:28:39 2019
New Revision: 347154
URL: https://svnweb.freebsd.org/changeset/base/347154
Log:
MFC r336511:
Whitespace changes due to changes in ident.
Modified:
stable/11/sys/netinet/sctp.h
stable/11/sys/netinet/sctp_asconf.c
stable/11/sys/netinet/sctp_asconf.h
stable/11/sys/netinet/sctp_auth.c
stable/11/sys/netinet/sctp_auth.h
stable/11/sys/netinet/sctp_bsd_addr.c
stable/11/sys/netinet/sctp_cc_functions.c
stable/11/sys/netinet/sctp_header.h
stable/11/sys/netinet/sctp_indata.c
stable/11/sys/netinet/sctp_indata.h
stable/11/sys/netinet/sctp_input.c
stable/11/sys/netinet/sctp_input.h
stable/11/sys/netinet/sctp_output.h
stable/11/sys/netinet/sctp_pcb.c
stable/11/sys/netinet/sctp_pcb.h
stable/11/sys/netinet/sctp_peeloff.c
stable/11/sys/netinet/sctp_structs.h
stable/11/sys/netinet/sctp_timer.c
stable/11/sys/netinet/sctp_uio.h
stable/11/sys/netinet/sctp_usrreq.c
stable/11/sys/netinet/sctp_var.h
stable/11/sys/netinet/sctputil.c
stable/11/sys/netinet/sctputil.h
stable/11/sys/netinet6/sctp6_usrreq.c
stable/11/sys/netinet6/sctp6_var.h
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/netinet/sctp.h
==============================================================================
--- stable/11/sys/netinet/sctp.h Sun May 5 12:11:58 2019 (r347153)
+++ stable/11/sys/netinet/sctp.h Sun May 5 12:28:39 2019 (r347154)
@@ -417,7 +417,7 @@ struct sctp_error_unresolv_addr {
struct sctp_error_unrecognized_chunk {
struct sctp_error_cause cause; /* code=SCTP_CAUSE_UNRECOG_CHUNK */
- struct sctp_chunkhdr ch;/* header from chunk in error */
+ struct sctp_chunkhdr ch; /* header from chunk in error */
} SCTP_PACKED;
struct sctp_error_no_user_data {
Modified: stable/11/sys/netinet/sctp_asconf.c
==============================================================================
--- stable/11/sys/netinet/sctp_asconf.c Sun May 5 12:11:58 2019 (r347153)
+++ stable/11/sys/netinet/sctp_asconf.c Sun May 5 12:28:39 2019 (r347154)
@@ -275,6 +275,7 @@ sctp_asconf_del_remote_addrs_except(struct sctp_tcb *s
/* not found */
return (-1);
}
+
/* delete all destination addresses except the source */
TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
if (net != src_net) {
@@ -381,6 +382,7 @@ sctp_process_asconf_delete_ip(struct sockaddr *src,
aparam_length);
return (m_reply);
}
+
/* if deleting 0.0.0.0/::0, delete all addresses except src addr */
if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) {
result = sctp_asconf_del_remote_addrs_except(stcb, src);
@@ -399,6 +401,7 @@ sctp_process_asconf_delete_ip(struct sockaddr *src,
}
return (m_reply);
}
+
/* delete the address */
result = sctp_del_remote_addr(stcb, sa);
/*
@@ -614,6 +617,7 @@ sctp_handle_asconf(struct mbuf *m, unsigned int offset
serial_num, asoc->asconf_seq_in + 1);
return;
}
+
/* it's the expected "next" sequence number, so process it */
asoc->asconf_seq_in = serial_num; /* update sequence */
/* get length of all the param's in the ASCONF */
@@ -638,6 +642,7 @@ sctp_handle_asconf(struct mbuf *m, unsigned int offset
SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_asconf_ack), ack);
}
}
+
m_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_asconf_ack_chunk), 0,
M_NOWAIT, 1, MT_DATA);
if (m_ack == NULL) {
@@ -972,6 +977,7 @@ sctp_assoc_immediate_retrans(struct sctp_tcb *stcb, st
if (stcb->asoc.deleted_primary == NULL) {
return;
}
+
if (!TAILQ_EMPTY(&stcb->asoc.sent_queue)) {
SCTPDBG(SCTP_DEBUG_ASCONF1, "assoc_immediate_retrans: Deleted primary is ");
SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, &stcb->asoc.deleted_primary->ro._l_addr.sa);
@@ -1075,6 +1081,7 @@ sctp_path_check_and_react(struct sctp_tcb *stcb, struc
}
return;
}
+
/* Multiple local addresses exsist in the association. */
TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
/* clear any cached route and source address */
@@ -1321,6 +1328,7 @@ sctp_asconf_queue_add(struct sctp_tcb *stcb, struct sc
if (stcb->asoc.asconf_supported == 0) {
return (-1);
}
+
/*
* if this is deleting the last address from the assoc, mark it as
* pending.
@@ -1341,6 +1349,7 @@ sctp_asconf_queue_add(struct sctp_tcb *stcb, struct sc
return (-1);
}
}
+
/* queue an asconf parameter */
status = sctp_asconf_queue_mgmt(stcb, ifa, type);
@@ -1362,6 +1371,7 @@ sctp_asconf_queue_add(struct sctp_tcb *stcb, struct sc
stcb->asoc.asconf_addr_del_pending = NULL;
}
}
+
if (pending_delete_queued) {
struct sctp_nets *net;
@@ -1386,6 +1396,7 @@ sctp_asconf_queue_add(struct sctp_tcb *stcb, struct sc
SCTP_FROM_SCTP_ASCONF,
__LINE__);
}
+
/* queue in an advisory set primary too */
(void)sctp_asconf_queue_mgmt(stcb, ifa, SCTP_SET_PRIM_ADDR);
/* let caller know we should send this out immediately */
@@ -1683,11 +1694,13 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset,
serial_num, asoc->asconf_seq_out_acked + 1);
return;
}
+
if (serial_num == asoc->asconf_seq_out - 1) {
/* stop our timer */
sctp_timer_stop(SCTP_TIMER_TYPE_ASCONF, stcb->sctp_ep, stcb, net,
SCTP_FROM_SCTP_ASCONF + SCTP_LOC_5);
}
+
/* process the ASCONF-ACK contents */
ack_length = ntohs(cp->ch.chunk_length) -
sizeof(struct sctp_asconf_ack_chunk);
@@ -1776,7 +1789,7 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset,
* at any given time
*/
if (last_error_id == 0)
- last_error_id--;/* set to "max" value */
+ last_error_id--; /* set to "max" value */
TAILQ_FOREACH_SAFE(aa, &stcb->asoc.asconf_queue, next, aa_next) {
if (aa->sent == 1) {
/*
@@ -2056,6 +2069,7 @@ sctp_asconf_iterator_ep_end(struct sctp_inpcb *inp, vo
laddr->action = 0;
break;
}
+
}
} else if (l->action == SCTP_DEL_IP_ADDRESS) {
LIST_FOREACH_SAFE(laddr, &inp->sctp_addr_list, sctp_nxt_addr, nladdr) {
@@ -2089,6 +2103,7 @@ sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, stru
if (ifa->vrf_id != stcb->asoc.vrf_id) {
continue;
}
+
/* Same checks again for assoc */
switch (ifa->address.sa.sa_family) {
#ifdef INET6
@@ -2279,6 +2294,7 @@ sctp_set_primary_ip_address_sa(struct sctp_tcb *stcb,
/* Invalid address */
return (-1);
}
+
/* queue an ASCONF:SET_PRIM_ADDR to be sent */
if (!sctp_asconf_queue_add(stcb, ifa, SCTP_SET_PRIM_ADDR)) {
/* set primary queuing succeeded */
@@ -2357,11 +2373,13 @@ sctp_is_addr_pending(struct sctp_tcb *stcb, struct sct
SCTPDBG(SCTP_DEBUG_ASCONF1, "is_addr_pending: param length(%u) too short\n", param_length);
break;
}
+
aph = (struct sctp_asconf_paramhdr *)sctp_m_getptr(chk->data, offset, param_length, aparam_buf);
if (aph == NULL) {
SCTPDBG(SCTP_DEBUG_ASCONF1, "is_addr_pending: couldn't get entire param\n");
break;
}
+
ph = (struct sctp_paramhdr *)(aph + 1);
if (sctp_addr_match(ph, &sctp_ifa->address.sa) != 0) {
switch (param_type) {
@@ -2376,6 +2394,7 @@ sctp_is_addr_pending(struct sctp_tcb *stcb, struct sct
}
last_param_type = param_type;
}
+
offset += SCTP_SIZE32(param_length);
if (offset >= asconf_limit) {
/* no more data in the mbuf chain */
@@ -2459,6 +2478,7 @@ sctp_find_valid_localaddr(struct sctp_tcb *stcb, int a
if (sctp_ifa->localifa_flags & SCTP_ADDR_IFA_UNUSEABLE) {
continue;
}
+
sin6 = &sctp_ifa->address.sin6;
if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
/*
@@ -2834,6 +2854,7 @@ sctp_process_initack_addresses(struct sctp_tcb *stcb,
}
}
}
+
next_addr:
/*
* Sanity check: Make sure the length isn't 0, otherwise
@@ -3368,6 +3389,7 @@ sctp_asconf_send_nat_state_update(struct sctp_tcb *stc
if (vrf == NULL) {
goto skip_rest;
}
+
SCTP_IPI_ADDR_RLOCK();
LIST_FOREACH(sctp_ifnp, &vrf->ifnlist, next_ifn) {
LIST_FOREACH(sctp_ifap, &sctp_ifnp->ifalist, next_ifa) {
Modified: stable/11/sys/netinet/sctp_asconf.h
==============================================================================
--- stable/11/sys/netinet/sctp_asconf.h Sun May 5 12:11:58 2019 (r347153)
+++ stable/11/sys/netinet/sctp_asconf.h Sun May 5 12:28:39 2019 (r347154)
@@ -58,10 +58,10 @@ sctp_addr_mgmt_ep_sa(struct sctp_inpcb *, struct socka
uint32_t, uint32_t, struct sctp_ifa *);
-extern int
+extern int
sctp_asconf_iterator_ep(struct sctp_inpcb *inp, void *ptr,
uint32_t val);
-extern void
+extern void
sctp_asconf_iterator_stcb(struct sctp_inpcb *inp,
struct sctp_tcb *stcb,
void *ptr, uint32_t type);
Modified: stable/11/sys/netinet/sctp_auth.c
==============================================================================
--- stable/11/sys/netinet/sctp_auth.c Sun May 5 12:11:58 2019 (r347153)
+++ stable/11/sys/netinet/sctp_auth.c Sun May 5 12:28:39 2019 (r347154)
@@ -1307,6 +1307,7 @@ sctp_auth_setactivekey(struct sctp_tcb *stcb, uint16_t
/* can't reactivate a deactivated key with other refcounts */
return (-1);
}
+
/* set the (new) active key */
stcb->asoc.authinfo.active_keyid = keyid;
/* reset the deactivated flag */
@@ -1361,6 +1362,7 @@ sctp_deact_sharedkey(struct sctp_tcb *stcb, uint16_t k
sctp_ulp_notify(SCTP_NOTIFY_AUTH_FREE_KEY, stcb, keyid, 0,
SCTP_SO_LOCKED);
}
+
/* mark the key as deactivated */
skey->deactivated = 1;
@@ -1580,6 +1582,7 @@ sctp_fill_hmac_digest_m(struct mbuf *m, uint32_t auth_
"Assoc Key");
#endif
}
+
/* set in the active key id */
auth->shared_key_id = htons(keyid);
@@ -1767,6 +1770,7 @@ sctp_notify_authentication(struct sctp_tcb *stcb, uint
/* If the socket is gone we are out of here */
return;
}
+
if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_AUTHEVNT))
/* event not enabled */
return;
@@ -1927,6 +1931,7 @@ sctp_validate_init_auth_params(struct mbuf *m, int off
if (num_chunks)
got_chklist = 1;
}
+
offset += SCTP_SIZE32(plen);
if (offset >= limit) {
break;
@@ -2021,6 +2026,7 @@ sctp_initialize_auth_params(struct sctp_inpcb *inp, st
new_key->key[keylen++] = i;
}
}
+
/* append in the HMACs */
ph = (struct sctp_paramhdr *)(new_key->key + keylen);
ph->param_type = htons(SCTP_HMAC_LIST);
Modified: stable/11/sys/netinet/sctp_auth.h
==============================================================================
--- stable/11/sys/netinet/sctp_auth.h Sun May 5 12:11:58 2019 (r347153)
+++ stable/11/sys/netinet/sctp_auth.h Sun May 5 12:28:39 2019 (r347154)
@@ -85,7 +85,7 @@ typedef struct sctp_hmaclist {
typedef struct sctp_authinformation {
sctp_key_t *random; /* local random key (concatenated) */
uint32_t random_len; /* local random number length for param */
- sctp_key_t *peer_random;/* peer's random key (concatenated) */
+ sctp_key_t *peer_random; /* peer's random key (concatenated) */
sctp_key_t *assoc_key; /* cached concatenated send key */
sctp_key_t *recv_key; /* cached concatenated recv key */
uint16_t active_keyid; /* active send keyid */
@@ -112,13 +112,13 @@ extern sctp_auth_chklist_t *sctp_copy_chunklist(sctp_a
extern int sctp_auth_add_chunk(uint8_t chunk, sctp_auth_chklist_t *list);
extern int sctp_auth_delete_chunk(uint8_t chunk, sctp_auth_chklist_t *list);
extern size_t sctp_auth_get_chklist_size(const sctp_auth_chklist_t *list);
-extern int
+extern int
sctp_serialize_auth_chunks(const sctp_auth_chklist_t *list,
uint8_t *ptr);
-extern int
+extern int
sctp_pack_auth_chunks(const sctp_auth_chklist_t *list,
uint8_t *ptr);
-extern int
+extern int
sctp_unpack_auth_chunks(const uint8_t *ptr, uint8_t num_chunks,
sctp_auth_chklist_t *list);
@@ -139,16 +139,16 @@ extern void sctp_free_sharedkey(sctp_sharedkey_t *skey
extern sctp_sharedkey_t *
sctp_find_sharedkey(struct sctp_keyhead *shared_keys,
uint16_t key_id);
-extern int
+extern int
sctp_insert_sharedkey(struct sctp_keyhead *shared_keys,
sctp_sharedkey_t *new_skey);
-extern int
+extern int
sctp_copy_skeylist(const struct sctp_keyhead *src,
struct sctp_keyhead *dest);
/* ref counts on shared keys, by key id */
extern void sctp_auth_key_acquire(struct sctp_tcb *stcb, uint16_t keyid);
-extern void
+extern void
sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t keyid,
int so_locked);
@@ -159,11 +159,11 @@ 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);
extern sctp_hmaclist_t *sctp_default_supported_hmaclist(void);
-extern uint16_t
+extern uint16_t
sctp_negotiate_hmacid(sctp_hmaclist_t *peer,
sctp_hmaclist_t *local);
extern int sctp_serialize_hmaclist(sctp_hmaclist_t *list, uint8_t *ptr);
-extern int
+extern int
sctp_verify_hmac_param(struct sctp_auth_hmac_algo *hmacs,
uint32_t num_hmacs);
@@ -173,22 +173,22 @@ extern void sctp_free_authinfo(sctp_authinfo_t *authin
/* keyed-HMAC functions */
extern uint32_t sctp_get_auth_chunk_len(uint16_t hmac_algo);
extern uint32_t sctp_get_hmac_digest_len(uint16_t hmac_algo);
-extern uint32_t
+extern uint32_t
sctp_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t keylen,
uint8_t *text, uint32_t textlen, uint8_t *digest);
-extern int
+extern int
sctp_verify_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t keylen,
uint8_t *text, uint32_t textlen, uint8_t *digest, uint32_t digestlen);
-extern uint32_t
+extern uint32_t
sctp_compute_hmac(uint16_t hmac_algo, sctp_key_t *key,
uint8_t *text, uint32_t textlen, uint8_t *digest);
extern int sctp_auth_is_supported_hmac(sctp_hmaclist_t *list, uint16_t id);
/* mbuf versions */
-extern uint32_t
+extern uint32_t
sctp_hmac_m(uint16_t hmac_algo, uint8_t *key, uint32_t keylen,
struct mbuf *m, uint32_t m_offset, uint8_t *digest, uint32_t trailer);
-extern uint32_t
+extern uint32_t
sctp_compute_hmac_m(uint16_t hmac_algo, sctp_key_t *key,
struct mbuf *m, uint32_t m_offset, uint8_t *digest);
@@ -204,26 +204,26 @@ extern int sctp_auth_setactivekey_ep(struct sctp_inpcb
extern int sctp_deact_sharedkey(struct sctp_tcb *stcb, uint16_t keyid);
extern int sctp_deact_sharedkey_ep(struct sctp_inpcb *inp, uint16_t keyid);
-extern void
+extern void
sctp_auth_get_cookie_params(struct sctp_tcb *stcb, struct mbuf *m,
uint32_t offset, uint32_t length);
-extern void
+extern void
sctp_fill_hmac_digest_m(struct mbuf *m, uint32_t auth_offset,
struct sctp_auth_chunk *auth, struct sctp_tcb *stcb, uint16_t key_id);
extern struct mbuf *
sctp_add_auth_chunk(struct mbuf *m, struct mbuf **m_end,
struct sctp_auth_chunk **auth_ret, uint32_t *offset,
struct sctp_tcb *stcb, uint8_t chunk);
-extern int
+extern int
sctp_handle_auth(struct sctp_tcb *stcb, struct sctp_auth_chunk *ch,
struct mbuf *m, uint32_t offset);
-extern void
+extern void
sctp_notify_authentication(struct sctp_tcb *stcb,
uint32_t indication, uint16_t keyid, uint16_t alt_keyid, int so_locked);
-extern int
+extern int
sctp_validate_init_auth_params(struct mbuf *m, int offset,
int limit);
-extern void
+extern void
sctp_initialize_auth_params(struct sctp_inpcb *inp,
struct sctp_tcb *stcb);
Modified: stable/11/sys/netinet/sctp_bsd_addr.c
==============================================================================
--- stable/11/sys/netinet/sctp_bsd_addr.c Sun May 5 12:11:58 2019 (r347153)
+++ stable/11/sys/netinet/sctp_bsd_addr.c Sun May 5 12:28:39 2019 (r347154)
@@ -303,10 +303,12 @@ sctp_addr_change(struct ifaddr *ifa, int cmd)
SCTP_BASE_VAR(first_time) = 1;
sctp_init_ifns_for_vrf(SCTP_DEFAULT_VRFID);
}
+
if ((cmd != RTM_ADD) && (cmd != RTM_DELETE)) {
/* don't know what to do with this */
return;
}
+
if (ifa->ifa_addr == NULL) {
return;
}
Modified: stable/11/sys/netinet/sctp_cc_functions.c
==============================================================================
--- stable/11/sys/netinet/sctp_cc_functions.c Sun May 5 12:11:58 2019 (r347153)
+++ stable/11/sys/netinet/sctp_cc_functions.c Sun May 5 12:28:39 2019 (r347154)
@@ -129,6 +129,7 @@ sctp_cwnd_update_after_fr(struct sctp_tcb *stcb,
t_ucwnd_sbw = 1;
}
}
+
/*-
* CMT fast recovery code. Need to debug. ((sctp_cmt_on_off > 0) &&
* (net->fast_retran_loss_recovery == 0)))
@@ -1117,6 +1118,7 @@ sctp_cwnd_update_after_ecn_echo_common(struct sctp_tcb
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) {
sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT);
}
+
}
SCTP_STAT_INCR(sctps_ecnereducedcwnd);
} else {
@@ -1316,7 +1318,7 @@ sctp_cwnd_update_rtcc_after_ecn_echo(struct sctp_tcb *
static
-void
+void
sctp_cwnd_update_rtcc_tsn_acknowledged(struct sctp_nets *net,
struct sctp_tmit_chunk *tp1)
{
@@ -1933,6 +1935,7 @@ measure_achieved_throughput(struct sctp_nets *net)
net->cc_mod.htcp_ca.lasttime = now;
return;
}
+
net->cc_mod.htcp_ca.bytecount += net->net_ack;
if ((net->cc_mod.htcp_ca.bytecount >= net->cwnd - (((net->cc_mod.htcp_ca.alpha >> 7) ? (net->cc_mod.htcp_ca.alpha >> 7) : 1) * net->mtu)) &&
(now - net->cc_mod.htcp_ca.lasttime >= net->cc_mod.htcp_ca.minRTT) &&
@@ -1969,6 +1972,7 @@ htcp_beta_update(struct htcp *ca, uint32_t minRTT, uin
return;
}
}
+
if (ca->modeswitch && minRTT > (uint32_t)MSEC_TO_TICKS(10) && maxRTT) {
ca->beta = (minRTT << 7) / maxRTT;
if (ca->beta < BETA_MIN)
@@ -1992,6 +1996,7 @@ htcp_alpha_update(struct htcp *ca)
diff -= hz;
factor = 1 + (10 * diff + ((diff / 2) * (diff / 2) / hz)) / hz;
}
+
if (use_rtt_scaling && minRTT) {
uint32_t scale = (hz << 3) / (10 * minRTT);
@@ -2001,6 +2006,7 @@ htcp_alpha_update(struct htcp *ca)
if (!factor)
factor = 1;
}
+
ca->alpha = 2 * factor * ((1 << 7) - ca->beta);
if (!ca->alpha)
ca->alpha = ALPHA_BASE;
@@ -2055,12 +2061,14 @@ htcp_cong_avoid(struct sctp_tcb *stcb, struct sctp_net
sctp_log_cwnd(stcb, net, net->mtu,
SCTP_CWND_LOG_FROM_SS);
}
+
} else {
net->cwnd += net->net_ack;
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) {
sctp_log_cwnd(stcb, net, net->net_ack,
SCTP_CWND_LOG_FROM_SS);
}
+
}
sctp_enforce_cwnd_limit(&stcb->asoc, net);
} else {
Modified: stable/11/sys/netinet/sctp_header.h
==============================================================================
--- stable/11/sys/netinet/sctp_header.h Sun May 5 12:11:58 2019 (r347153)
+++ stable/11/sys/netinet/sctp_header.h Sun May 5 12:28:39 2019 (r347154)
@@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$");
* Parameter structures
*/
struct sctp_ipv4addr_param {
- struct sctp_paramhdr ph;/* type=SCTP_IPV4_PARAM_TYPE, len=8 */
+ struct sctp_paramhdr ph; /* type=SCTP_IPV4_PARAM_TYPE, len=8 */
uint32_t addr; /* IPV4 address */
} SCTP_PACKED;
@@ -54,20 +54,20 @@ struct sctp_ipv4addr_param {
struct sctp_ipv6addr_param {
- struct sctp_paramhdr ph;/* type=SCTP_IPV6_PARAM_TYPE, len=20 */
+ struct sctp_paramhdr ph; /* type=SCTP_IPV6_PARAM_TYPE, len=20 */
uint8_t addr[SCTP_V6_ADDR_BYTES]; /* IPV6 address */
} SCTP_PACKED;
/* Cookie Preservative */
struct sctp_cookie_perserve_param {
- struct sctp_paramhdr ph;/* type=SCTP_COOKIE_PRESERVE, len=8 */
+ struct sctp_paramhdr ph; /* type=SCTP_COOKIE_PRESERVE, len=8 */
uint32_t time; /* time in ms to extend cookie */
} SCTP_PACKED;
#define SCTP_ARRAY_MIN_LEN 1
/* Host Name Address */
struct sctp_host_name_param {
- struct sctp_paramhdr ph;/* type=SCTP_HOSTNAME_ADDRESS */
+ struct sctp_paramhdr ph; /* type=SCTP_HOSTNAME_ADDRESS */
char name[SCTP_ARRAY_MIN_LEN]; /* host name */
} SCTP_PACKED;
@@ -78,7 +78,7 @@ struct sctp_host_name_param {
#define SCTP_MAX_ADDR_PARAMS_SIZE 12
/* supported address type */
struct sctp_supported_addr_param {
- struct sctp_paramhdr ph;/* type=SCTP_SUPPORTED_ADDRTYPE */
+ struct sctp_paramhdr ph; /* type=SCTP_SUPPORTED_ADDRTYPE */
uint16_t addr_type[2]; /* array of supported address types */
} SCTP_PACKED;
@@ -106,8 +106,8 @@ struct sctp_prsctp_supported_param {
/* draft-ietf-tsvwg-addip-sctp */
struct sctp_asconf_paramhdr { /* an ASCONF "parameter" */
- struct sctp_paramhdr ph;/* a SCTP parameter header */
- uint32_t correlation_id;/* correlation id for this param */
+ struct sctp_paramhdr ph; /* a SCTP parameter header */
+ uint32_t correlation_id; /* correlation id for this param */
} SCTP_PACKED;
struct sctp_asconf_addr_param { /* an ASCONF address parameter */
@@ -131,7 +131,7 @@ struct sctp_asconf_addrv4_param { /* an ASCONF address
#define SCTP_MAX_SUPPORTED_EXT 256
struct sctp_supported_chunk_types_param {
- struct sctp_paramhdr ph;/* type = 0x8008 len = x */
+ struct sctp_paramhdr ph; /* type = 0x8008 len = x */
uint8_t chunk_types[];
} SCTP_PACKED;
@@ -204,8 +204,8 @@ struct sctp_state_cookie { /* this is our definition..
uint16_t peerport; /* port address of the peer in the INIT */
uint16_t myport; /* my port address used in the INIT */
- uint8_t ipv4_addr_legal;/* Are V4 addr legal? */
- uint8_t ipv6_addr_legal;/* Are V6 addr legal? */
+ uint8_t ipv4_addr_legal; /* Are V4 addr legal? */
+ uint8_t ipv6_addr_legal; /* Are V6 addr legal? */
uint8_t local_scope; /* IPv6 local scope flag */
uint8_t site_scope; /* IPv6 site scope flag */
@@ -510,17 +510,17 @@ struct sctp_stream_reset_resp_tsn {
/* Should we make the max be 32? */
#define SCTP_RANDOM_MAX_SIZE 256
struct sctp_auth_random {
- struct sctp_paramhdr ph;/* type = 0x8002 */
+ struct sctp_paramhdr ph; /* type = 0x8002 */
uint8_t random_data[];
} SCTP_PACKED;
struct sctp_auth_chunk_list {
- struct sctp_paramhdr ph;/* type = 0x8003 */
+ struct sctp_paramhdr ph; /* type = 0x8003 */
uint8_t chunk_types[];
} SCTP_PACKED;
struct sctp_auth_hmac_algo {
- struct sctp_paramhdr ph;/* type = 0x8004 */
+ struct sctp_paramhdr ph; /* type = 0x8004 */
uint16_t hmac_ids[];
} SCTP_PACKED;
Modified: stable/11/sys/netinet/sctp_indata.c
==============================================================================
--- stable/11/sys/netinet/sctp_indata.c Sun May 5 12:11:58 2019 (r347153)
+++ stable/11/sys/netinet/sctp_indata.c Sun May 5 12:28:39 2019 (r347154)
@@ -88,6 +88,7 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_asso
if (stcb->sctp_socket == NULL) {
return (calc);
}
+
KASSERT(asoc->cnt_on_reasm_queue > 0 || asoc->size_on_reasm_queue == 0,
("size_on_reasm_queue is %u", asoc->size_on_reasm_queue));
KASSERT(asoc->cnt_on_all_streams > 0 || asoc->size_on_all_streams == 0,
@@ -113,6 +114,7 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_asso
/* out of space */
return (calc);
}
+
/* what is the overhead of all these rwnd's */
calc = sctp_sbspace_sub(calc, stcb->asoc.my_rwnd_control_len);
/*
@@ -183,6 +185,7 @@ sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct s
/* user does not want any ancillary data */
return (NULL);
}
+
len = 0;
if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO)) {
len += CMSG_SPACE(sizeof(struct sctp_rcvinfo));
@@ -1042,6 +1045,7 @@ place_chunk:
SCTP_FROM_SCTP_INDATA + SCTP_LOC_5);
return;
}
+
}
if (inserted == 0) {
/* Its at the end */
@@ -2136,6 +2140,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc
control = NULL;
goto finish_express_del;
}
+
/* Now will we need a chunk too? */
if ((chk_flags & SCTP_DATA_NOT_FRAG) != SCTP_DATA_NOT_FRAG) {
sctp_alloc_a_chunk(stcb, chk);
@@ -3094,6 +3099,7 @@ sctp_process_segment_range(struct sctp_tcb *stcb, stru
tp1->do_rtt = 0;
}
}
+
}
if (tp1->sent <= SCTP_DATAGRAM_RESEND) {
if (SCTP_TSN_GT(tp1->rec.data.tsn,
@@ -3359,6 +3365,7 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, stru
continue;
}
}
+
}
if (SCTP_TSN_GT(tp1->rec.data.tsn, asoc->this_sack_highest_gap) &&
!(accum_moved && asoc->fast_retran_loss_recovery)) {
@@ -3594,6 +3601,7 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, stru
tp1);
}
}
+
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_RWND_ENABLE) {
sctp_log_rwnd(SCTP_INCREASE_PEER_RWND,
asoc->peers_rwnd, tp1->send_size, SCTP_BASE_SYSCTL(sctp_peer_chunk_oh));
@@ -3675,6 +3683,7 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, stru
tp1->whoTo->find_pseudo_cumack = 1;
tp1->whoTo->find_rtx_pseudo_cumack = 1;
}
+
} else { /* CMT is OFF */
#ifdef SCTP_FR_TO_ALTERNATE
@@ -3963,6 +3972,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32
}
return;
}
+
/* First setup for CC stuff */
TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
if (SCTP_TSN_GT(cumack, net->cwr_window_tsn)) {
@@ -4228,6 +4238,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32
asoc->total_flight = 0;
asoc->total_flight_count = 0;
}
+
/* RWND update */
asoc->peers_rwnd = sctp_sbspace_sub(rwnd,
(uint32_t)(asoc->total_flight + (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh))));
@@ -4480,6 +4491,7 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int o
sctp_misc_ints(SCTP_SACK_LOG_NORMAL, cum_ack,
rwnd, stcb->asoc.last_acked_seq, stcb->asoc.peers_rwnd);
}
+
old_rwnd = stcb->asoc.peers_rwnd;
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) {
sctp_misc_ints(SCTP_THRESHOLD_CLEAR,
@@ -4551,6 +4563,7 @@ hopeless_peer:
/* acking something behind */
return;
}
+
/* update the Rwnd of the peer */
if (TAILQ_EMPTY(&asoc->sent_queue) &&
TAILQ_EMPTY(&asoc->send_queue) &&
@@ -4604,6 +4617,7 @@ hopeless_peer:
if (stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) {
(*stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) (stcb, net);
}
+
/*
* CMT: SFR algo (and HTNA) - this_sack_highest_newack has
* to be greater than the cumack. Also reset saw_newack to 0
@@ -4839,6 +4853,7 @@ hopeless_peer:
#endif
asoc->total_flight = 0;
}
+
/* sa_ignore NO_NULL_CHK */
if ((wake_him) && (stcb->sctp_socket)) {
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
@@ -4943,6 +4958,7 @@ hopeless_peer:
sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb,
0, (void *)net, SCTP_SO_NOT_LOCKED);
}
+
if (net == stcb->asoc.primary_destination) {
if (stcb->asoc.alternate) {
/*
@@ -4953,6 +4969,7 @@ hopeless_peer:
stcb->asoc.alternate = NULL;
}
}
+
if (net->dest_state & SCTP_ADDR_PF) {
net->dest_state &= ~SCTP_ADDR_PF;
sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT,
@@ -4975,6 +4992,7 @@ hopeless_peer:
}
asoc->cc_functions.sctp_cwnd_update_after_sack(stcb, asoc, accum_moved, reneged_all, will_exit_fast_recovery);
}
+
if (TAILQ_EMPTY(&asoc->sent_queue)) {
/* nothing left in-flight */
TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
@@ -4988,6 +5006,7 @@ hopeless_peer:
asoc->total_flight = 0;
asoc->total_flight_count = 0;
}
+
/**********************************/
/* Now what about shutdown issues */
/**********************************/
@@ -5122,6 +5141,7 @@ hopeless_peer:
if (asoc->peers_rwnd > old_rwnd) {
win_probe_recovery = 1;
}
+
/*
* Now we must setup so we have a timer up for anyone with
* outstanding data.
Modified: stable/11/sys/netinet/sctp_indata.h
==============================================================================
--- stable/11/sys/netinet/sctp_indata.h Sun May 5 12:11:58 2019 (r347153)
+++ stable/11/sys/netinet/sctp_indata.h Sun May 5 12:28:39 2019 (r347154)
@@ -97,8 +97,7 @@ void
sctp_handle_forward_tsn(struct sctp_tcb *,
struct sctp_forward_tsn_chunk *, int *, struct mbuf *, int);
-struct sctp_tmit_chunk *
- sctp_try_advance_peer_ack_point(struct sctp_tcb *, struct sctp_association *);
+struct sctp_tmit_chunk *sctp_try_advance_peer_ack_point(struct sctp_tcb *, struct sctp_association *);
void sctp_service_queues(struct sctp_tcb *, struct sctp_association *);
Modified: stable/11/sys/netinet/sctp_input.c
==============================================================================
--- stable/11/sys/netinet/sctp_input.c Sun May 5 12:11:58 2019 (r347153)
+++ stable/11/sys/netinet/sctp_input.c Sun May 5 12:28:39 2019 (r347154)
@@ -305,6 +305,7 @@ sctp_process_init(struct sctp_init_chunk *cp, struct s
if (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_CWND_MONITOR_ENABLE | SCTP_CWND_LOGGING_ENABLE)) {
sctp_log_cwnd(stcb, lnet, 0, SCTP_CWND_INITIALIZATION);
}
+
}
}
SCTP_TCB_SEND_LOCK(stcb);
@@ -491,6 +492,7 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int
SCTP_FREE(param, SCTP_M_ASC_ADDR);
}
}
+
stcb->asoc.peer_hmac_id = sctp_negotiate_hmacid(stcb->asoc.peer_hmacs,
stcb->asoc.local_hmacs);
if (op_err) {
@@ -553,6 +555,7 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int
}
return (retval);
}
+
return (0);
}
@@ -570,6 +573,7 @@ sctp_handle_heartbeat_ack(struct sctp_heartbeat_chunk
/* Invalid length */
return;
}
+
memset(&store, 0, sizeof(store));
switch (cp->heartbeat.hb_info.addr_family) {
#ifdef INET
@@ -1717,6 +1721,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle
asoc->cookie_how[how_indx] = 5;
return (stcb);
}
+
if (ntohl(initack_cp->init.initiate_tag) != asoc->my_vtag &&
ntohl(init_cp->init.initiate_tag) == asoc->peer_vtag &&
cookie->tie_tag_my_vtag == 0 &&
@@ -2292,6 +2297,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in
stcb->asoc.authenticated = 1;
}
}
+
/*
* if we're doing ASCONFs, check to see if we have any new local
* addresses that need to get added to the peer (eg. addresses
@@ -2589,6 +2595,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in
(uint32_t)offset, cookie_offset, sig_offset);
return (NULL);
}
+
/*
* check the cookie timestamps to be sure it's not stale
*/
@@ -2709,6 +2716,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in
}
}
}
+
cookie_len -= SCTP_SIGNATURE_SIZE;
if (*stcb == NULL) {
/* this is the "normal" case... get a new TCB */
@@ -2911,6 +2919,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in
sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED,
(*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED);
}
+
/*
* Pull it from the incomplete queue and wake the
* guy
@@ -2951,6 +2960,7 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *c
if ((stcb == NULL) || (net == NULL)) {
return;
}
+
asoc = &stcb->asoc;
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) {
sctp_misc_ints(SCTP_THRESHOLD_CLEAR,
@@ -3017,6 +3027,7 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *c
*/
goto closed_socket;
}
+
sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep,
stcb, net);
@@ -3795,6 +3806,7 @@ sctp_handle_stream_reset_response(struct sctp_tcb *stc
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) {
sctp_log_map(0, 7, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT);
}
+
stcb->asoc.tsn_last_delivered = stcb->asoc.cumulative_tsn = stcb->asoc.highest_tsn_inside_map;
stcb->asoc.mapping_array_base_tsn = ntohl(resp->senders_next_tsn);
memset(stcb->asoc.mapping_array, 0, stcb->asoc.mapping_array_size);
@@ -4394,6 +4406,7 @@ sctp_handle_packet_dropped(struct sctp_pktdrop_chunk *
if (trunc_len > limit) {
trunc_len = limit;
}
+
/* now the chunks themselves */
while ((ch != NULL) && (chlen >= sizeof(struct sctp_chunkhdr))) {
desc.chunk_type = ch->chunk_type;
@@ -4653,6 +4666,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int *
*/
SCTP_INP_DECR_REF(inp);
}
+
/* now go back and verify any auth chunk to be sure */
if (auth_skipped && (stcb != NULL)) {
struct sctp_auth_chunk *auth;
@@ -4752,6 +4766,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int *
sctp_handle_cookie_ack((struct sctp_cookie_ack_chunk *)ch, stcb,
*netp);
}
+
process_control_chunks:
while (IS_SCTP_CONTROL(ch)) {
/* validate chunk length */
@@ -4791,6 +4806,7 @@ process_control_chunks:
}
return (NULL);
}
+
num_chunks++;
/* Save off the last place we got a control from */
if (stcb != NULL) {
@@ -5145,6 +5161,7 @@ process_control_chunks:
goto abend;
}
}
+
if (netp != NULL) {
struct sctp_tcb *locked_stcb;
@@ -5317,6 +5334,7 @@ process_control_chunks:
*offset = length;
return (stcb);
}
+
if (stcb != NULL) {
int abort_flag = 0;
@@ -5379,6 +5397,7 @@ process_control_chunks:
*offset = length;
return (stcb);
}
+
if ((ch != NULL) && (stcb != NULL) && (netp != NULL) && (*netp != NULL)) {
if (stcb->asoc.pktdrop_supported == 0) {
goto unknown_chunk;
@@ -5641,6 +5660,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph
vrf_id, port);
goto out;
}
+
}
if (IS_SCTP_CONTROL(ch)) {
/* process the control portion of the SCTP packet */
@@ -5716,6 +5736,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph
*/
goto out;
}
+
/*
* DATA chunk processing
*/
@@ -5794,6 +5815,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph
* process_data
*/
}
+
/* take care of ecn */
if ((data_processed == 1) &&
(stcb->asoc.ecn_supported == 1) &&
@@ -5801,6 +5823,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph
/* Yep, we need to add a ECNE */
sctp_send_ecn_echo(stcb, net, high_tsn);
}
+
if ((data_processed == 0) && (fwd_tsn_seen)) {
int was_a_gap;
uint32_t highest_tsn;
Modified: stable/11/sys/netinet/sctp_input.h
==============================================================================
--- stable/11/sys/netinet/sctp_input.h Sun May 5 12:11:58 2019 (r347153)
+++ stable/11/sys/netinet/sctp_input.h Sun May 5 12:28:39 2019 (r347154)
@@ -50,7 +50,7 @@ struct sctp_stream_reset_request *
sctp_find_stream_reset(struct sctp_tcb *stcb, uint32_t seq,
struct sctp_tmit_chunk **bchk);
-void
+void
sctp_reset_in_stream(struct sctp_tcb *stcb, uint32_t number_entries,
uint16_t *list);
Modified: stable/11/sys/netinet/sctp_output.h
==============================================================================
--- stable/11/sys/netinet/sctp_output.h Sun May 5 12:11:58 2019 (r347153)
+++ stable/11/sys/netinet/sctp_output.h Sun May 5 12:28:39 2019 (r347154)
@@ -72,7 +72,7 @@ int
int
sctp_v4src_match_nexthop(struct sctp_ifa *sifa, sctp_route_t *ro);
-void
+void
sctp_send_initiate(struct sctp_inpcb *, struct sctp_tcb *, int
#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
SCTP_UNUSED
@@ -115,7 +115,7 @@ void sctp_send_shutdown_ack(struct sctp_tcb *, struct
void sctp_send_shutdown_complete(struct sctp_tcb *, struct sctp_nets *, int);
-void
+void
sctp_send_shutdown_complete2(struct sockaddr *, struct sockaddr *,
struct sctphdr *,
uint8_t, uint32_t, uint16_t,
@@ -144,13 +144,13 @@ int
sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *,
struct mbuf *, struct thread *, int);
-void
+void
sctp_chunk_output(struct sctp_inpcb *, struct sctp_tcb *, int, int
#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
SCTP_UNUSED
#endif
);
-void
+void
sctp_send_abort_tcb(struct sctp_tcb *, struct mbuf *, int
#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
SCTP_UNUSED
@@ -199,7 +199,7 @@ sctp_send_abort(struct mbuf *, int, struct sockaddr *,
uint8_t, uint32_t, uint16_t,
uint32_t, uint16_t);
-void
+void
sctp_send_operr_to(struct sockaddr *, struct sockaddr *,
struct sctphdr *, uint32_t, struct mbuf *,
uint8_t, uint32_t, uint16_t,
Modified: stable/11/sys/netinet/sctp_pcb.c
==============================================================================
--- stable/11/sys/netinet/sctp_pcb.c Sun May 5 12:11:58 2019 (r347153)
+++ stable/11/sys/netinet/sctp_pcb.c Sun May 5 12:28:39 2019 (r347154)
@@ -183,6 +183,7 @@ sctp_allocate_vrf(int vrf_id)
SCTP_FREE(vrf, SCTP_M_VRF);
return (NULL);
}
+
/* Add it to the hash table */
bucket = &SCTP_BASE_INFO(sctp_vrfhash)[(vrf_id & SCTP_BASE_INFO(hashvrfmark))];
LIST_INSERT_HEAD(bucket, vrf, next_vrf);
@@ -734,6 +735,7 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockadd
SCTPDBG(SCTP_DEBUG_PCB4, "Can't find vrf_id 0x%x\n", vrf_id);
goto out_now;
}
+
#ifdef SCTP_DEBUG
SCTPDBG(SCTP_DEBUG_PCB4, "vrf_id 0x%x: deleting address:", vrf_id);
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-all
mailing list