Whitespace changes.

MFC after: 1 month
This commit is contained in:
Michael Tuexen 2016-10-13 13:38:14 +00:00
parent 2a21e8bd77
commit 4c7fb0cf6e

View File

@ -77,7 +77,6 @@ SCTP6_ARE_ADDR_EQUAL(struct sockaddr_in6 *a, struct sockaddr_in6 *b)
} }
return (IN6_ARE_ADDR_EQUAL(&tmp_a.sin6_addr, &tmp_b.sin6_addr)); return (IN6_ARE_ADDR_EQUAL(&tmp_a.sin6_addr, &tmp_b.sin6_addr));
} }
#endif #endif
void void
@ -837,14 +836,11 @@ static int
sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to) sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to)
{ {
int loopback_scope; int loopback_scope;
#if defined(INET) #if defined(INET)
int ipv4_local_scope, ipv4_addr_legal; int ipv4_local_scope, ipv4_addr_legal;
#endif #endif
#if defined(INET6) #if defined(INET6)
int local_scope, site_scope, ipv6_addr_legal; int local_scope, site_scope, ipv6_addr_legal;
#endif #endif
struct sctp_vrf *vrf; struct sctp_vrf *vrf;
struct sctp_ifn *sctp_ifn; struct sctp_ifn *sctp_ifn;
@ -1216,10 +1212,8 @@ sctp_tcb_special_locate(struct sctp_inpcb **inp_p, struct sockaddr *from,
if (netp != NULL) { if (netp != NULL) {
*netp = net; *netp = net;
} }
/* /* Update the endpoint
* Update the endpoint * pointer */
* pointer
*/
*inp_p = inp; *inp_p = inp;
SCTP_INP_RUNLOCK(inp); SCTP_INP_RUNLOCK(inp);
return (stcb); return (stcb);
@ -1240,10 +1234,8 @@ sctp_tcb_special_locate(struct sctp_inpcb **inp_p, struct sockaddr *from,
if (netp != NULL) { if (netp != NULL) {
*netp = net; *netp = net;
} }
/* /* Update the endpoint
* Update the endpoint * pointer */
* pointer
*/
*inp_p = inp; *inp_p = inp;
SCTP_INP_RUNLOCK(inp); SCTP_INP_RUNLOCK(inp);
return (stcb); return (stcb);
@ -1622,15 +1614,12 @@ sctp_endpoint_probe(struct sockaddr *nam, struct sctppcbhead *head,
{ {
struct sctp_inpcb *inp; struct sctp_inpcb *inp;
struct sctp_laddr *laddr; struct sctp_laddr *laddr;
#ifdef INET #ifdef INET
struct sockaddr_in *sin; struct sockaddr_in *sin;
#endif #endif
#ifdef INET6 #ifdef INET6
struct sockaddr_in6 *sin6; struct sockaddr_in6 *sin6;
struct sockaddr_in6 *intf_addr6; struct sockaddr_in6 *intf_addr6;
#endif #endif
int fnd; int fnd;
@ -1673,10 +1662,8 @@ sctp_endpoint_probe(struct sockaddr *nam, struct sctppcbhead *head,
case AF_INET: case AF_INET:
if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) &&
SCTP_IPV6_V6ONLY(inp)) { SCTP_IPV6_V6ONLY(inp)) {
/* /* IPv4 on a IPv6 socket with ONLY
* IPv4 on a IPv6 socket with ONLY * IPv6 set */
* IPv6 set
*/
SCTP_INP_RUNLOCK(inp); SCTP_INP_RUNLOCK(inp);
continue; continue;
} }
@ -1689,10 +1676,8 @@ sctp_endpoint_probe(struct sockaddr *nam, struct sctppcbhead *head,
#endif #endif
#ifdef INET6 #ifdef INET6
case AF_INET6: case AF_INET6:
/* /* A V6 address and the endpoint is NOT
* A V6 address and the endpoint is NOT * bound V6 */
* bound V6
*/
if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) { if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) {
SCTP_INP_RUNLOCK(inp); SCTP_INP_RUNLOCK(inp);
continue; continue;
@ -1926,14 +1911,11 @@ sctp_pcb_findep(struct sockaddr *nam, int find_tcp_pool, int have_lock,
struct sctppcbhead *head; struct sctppcbhead *head;
int lport; int lport;
unsigned int i; unsigned int i;
#ifdef INET #ifdef INET
struct sockaddr_in *sin; struct sockaddr_in *sin;
#endif #endif
#ifdef INET6 #ifdef INET6
struct sockaddr_in6 *sin6; struct sockaddr_in6 *sin6;
#endif #endif
switch (nam->sa_family) { switch (nam->sa_family) {
@ -2057,21 +2039,16 @@ sctp_findassociation_special_addr(struct mbuf *m, int offset,
struct sockaddr *dst) struct sockaddr *dst)
{ {
struct sctp_paramhdr *phdr, parm_buf; struct sctp_paramhdr *phdr, parm_buf;
#if defined(INET) || defined(INET6) #if defined(INET) || defined(INET6)
struct sctp_tcb *stcb; struct sctp_tcb *stcb;
uint16_t ptype; uint16_t ptype;
#endif #endif
uint16_t plen; uint16_t plen;
#ifdef INET #ifdef INET
struct sockaddr_in sin4; struct sockaddr_in sin4;
#endif #endif
#ifdef INET6 #ifdef INET6
struct sockaddr_in6 sin6; struct sockaddr_in6 sin6;
#endif #endif
#ifdef INET #ifdef INET
@ -2198,10 +2175,8 @@ sctp_findassoc_by_vtag(struct sockaddr *from, struct sockaddr *to, uint32_t vtag
continue; continue;
} }
if (remote_tag) { if (remote_tag) {
/* /* If we have both vtags that's all we match
* If we have both vtags that's all we match * on */
* on
*/
if (stcb->asoc.peer_vtag == remote_tag) { if (stcb->asoc.peer_vtag == remote_tag) {
/* /*
* If both tags match we consider it * If both tags match we consider it
@ -2319,14 +2294,11 @@ sctp_findassociation_ep_asconf(struct mbuf *m, int offset,
struct sctp_paramhdr parm_buf, *phdr; struct sctp_paramhdr parm_buf, *phdr;
int ptype; int ptype;
int zero_address = 0; int zero_address = 0;
#ifdef INET #ifdef INET
struct sockaddr_in *sin; struct sockaddr_in *sin;
#endif #endif
#ifdef INET6 #ifdef INET6
struct sockaddr_in6 *sin6; struct sockaddr_in6 *sin6;
#endif #endif
memset(&remote_store, 0, sizeof(remote_store)); memset(&remote_store, 0, sizeof(remote_store));
@ -2897,10 +2869,8 @@ sctp_inpcb_bind(struct socket *so, struct sockaddr *addr,
#ifdef INET6 #ifdef INET6
case AF_INET6: case AF_INET6:
{ {
/* /* Only for pure IPv6 Address. (No IPv4
* Only for pure IPv6 Address. (No IPv4 * Mapped!) */
* Mapped!)
*/
struct sockaddr_in6 *sin6; struct sockaddr_in6 *sin6;
sin6 = (struct sockaddr_in6 *)addr; sin6 = (struct sockaddr_in6 *)addr;
@ -2977,10 +2947,8 @@ sctp_inpcb_bind(struct socket *so, struct sockaddr *addr,
/* unlock info */ /* unlock info */
if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE)) && if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE)) &&
(sctp_is_feature_on(inp_tmp, SCTP_PCB_FLAGS_PORTREUSE))) { (sctp_is_feature_on(inp_tmp, SCTP_PCB_FLAGS_PORTREUSE))) {
/* /* Ok, must be one-2-one and
* Ok, must be one-2-one and * allowing port re-use */
* allowing port re-use
*/
port_reuse_active = 1; port_reuse_active = 1;
goto continue_anyway; goto continue_anyway;
} }
@ -3003,10 +2971,8 @@ sctp_inpcb_bind(struct socket *so, struct sockaddr *addr,
/* unlock info */ /* unlock info */
if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE)) && if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE)) &&
(sctp_is_feature_on(inp_tmp, SCTP_PCB_FLAGS_PORTREUSE))) { (sctp_is_feature_on(inp_tmp, SCTP_PCB_FLAGS_PORTREUSE))) {
/* /* Ok, must be one-2-one and
* Ok, must be one-2-one and * allowing port re-use */
* allowing port re-use
*/
port_reuse_active = 1; port_reuse_active = 1;
goto continue_anyway; goto continue_anyway;
} }
@ -3146,11 +3112,11 @@ continue_anyway:
* bind specific, make sure flags is off and add a new * bind specific, make sure flags is off and add a new
* address structure to the sctp_addr_list inside the ep * address structure to the sctp_addr_list inside the ep
* structure. * structure.
* *
* We will need to allocate one and insert it at the head. The * We will need to allocate one and insert it at the head.
* socketopt call can just insert new addresses in there as * The socketopt call can just insert new addresses in there
* well. It will also have to do the embed scope kame hack * as well. It will also have to do the embed scope kame
* too (before adding). * hack too (before adding).
*/ */
struct sctp_ifa *ifa; struct sctp_ifa *ifa;
union sctp_sockstore store; union sctp_sockstore store;
@ -3268,11 +3234,11 @@ sctp_iterator_inp_being_freed(struct sctp_inpcb *inp)
* from happening. But of course the iterator has a * from happening. But of course the iterator has a
* reference on the stcb and inp. We can mark it and it will * reference on the stcb and inp. We can mark it and it will
* stop. * stop.
* *
* If its a single iterator situation, we set the end iterator * If its a single iterator situation, we set the end
* flag. Otherwise we set the iterator to go to the next * iterator flag. Otherwise we set the iterator to go to the
* inp. * next inp.
* *
*/ */
if (it->iterator_flags & SCTP_ITERATOR_DO_SINGLE_INP) { if (it->iterator_flags & SCTP_ITERATOR_DO_SINGLE_INP) {
sctp_it_ctl.iterator_flags |= SCTP_ITERATOR_STOP_CUR_IT; sctp_it_ctl.iterator_flags |= SCTP_ITERATOR_STOP_CUR_IT;
@ -3305,10 +3271,8 @@ sctp_iterator_inp_being_freed(struct sctp_inpcb *inp)
SCTP_INP_INCR_REF(it->inp); SCTP_INP_INCR_REF(it->inp);
} }
} }
/* /* When its put in the refcnt is incremented so decr
* When its put in the refcnt is incremented so decr * it */
* it
*/
SCTP_INP_DECR_REF(inp); SCTP_INP_DECR_REF(inp);
} }
} }
@ -3991,10 +3955,8 @@ sctp_add_remote_addr(struct sctp_tcb *stcb, struct sockaddr *newaddr,
rmtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, net->ro.ro_rt); rmtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, net->ro.ro_rt);
if (rmtu == 0) { if (rmtu == 0) {
/* /* Start things off to match mtu of
* Start things off to match mtu of * interface please. */
* interface please.
*/
SCTP_SET_MTU_OF_ROUTE(&net->ro._l_addr.sa, SCTP_SET_MTU_OF_ROUTE(&net->ro._l_addr.sa,
net->ro.ro_rt, net->mtu); net->ro.ro_rt, net->mtu);
} else { } else {
@ -5484,10 +5446,8 @@ sctp_del_local_addr_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa)
if (stcb->asoc.last_used_address == laddr) if (stcb->asoc.last_used_address == laddr)
/* delete this address */ /* delete this address */
stcb->asoc.last_used_address = NULL; stcb->asoc.last_used_address = NULL;
/* /* Now spin through all the nets and purge any ref
* Now spin through all the nets and purge any ref * to laddr */
* to laddr
*/
TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
if (net->ro._s_addr == laddr->ifa) { if (net->ro._s_addr == laddr->ifa) {
/* Yep, purge src address selected */ /* Yep, purge src address selected */
@ -5755,7 +5715,6 @@ sctp_startup_mcore_threads(void)
} }
} }
#endif #endif
void void
@ -6097,14 +6056,11 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m,
uint8_t peer_supports_nrsack; uint8_t peer_supports_nrsack;
uint8_t peer_supports_pktdrop; uint8_t peer_supports_pktdrop;
uint8_t peer_supports_idata; uint8_t peer_supports_idata;
#ifdef INET #ifdef INET
struct sockaddr_in sin; struct sockaddr_in sin;
#endif #endif
#ifdef INET6 #ifdef INET6
struct sockaddr_in6 sin6; struct sockaddr_in6 sin6;
#endif #endif
/* First get the destination address setup too. */ /* First get the destination address setup too. */
@ -6267,10 +6223,8 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m,
struct mbuf *op_err; struct mbuf *op_err;
char msg[SCTP_DIAG_INFO_LEN]; char msg[SCTP_DIAG_INFO_LEN];
/* /* in setup state we
* in setup state we * abort this guy */
* abort this guy
*/
snprintf(msg, sizeof(msg), snprintf(msg, sizeof(msg),
"%s:%d at %s", __FILE__, __LINE__, __func__); "%s:%d at %s", __FILE__, __LINE__, __func__);
op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
@ -6312,10 +6266,8 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m,
goto next_param; goto next_param;
} }
if (IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr)) { if (IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr)) {
/* /* Link local make no sense without
* Link local make no sense without * scope */
* scope
*/
goto next_param; goto next_param;
} }
sa = (struct sockaddr *)&sin6; sa = (struct sockaddr *)&sin6;
@ -6366,10 +6318,8 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m,
struct mbuf *op_err; struct mbuf *op_err;
char msg[SCTP_DIAG_INFO_LEN]; char msg[SCTP_DIAG_INFO_LEN];
/* /* in setup state we
* in setup state we * abort this guy */
* abort this guy
*/
snprintf(msg, sizeof(msg), snprintf(msg, sizeof(msg),
"%s:%d at %s", __FILE__, __LINE__, __func__); "%s:%d at %s", __FILE__, __LINE__, __func__);
op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
@ -6409,10 +6359,8 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m,
struct sctp_asconf_addr_param lstore, *fee; struct sctp_asconf_addr_param lstore, *fee;
int lptype; int lptype;
struct sockaddr *lsa = NULL; struct sockaddr *lsa = NULL;
#ifdef INET #ifdef INET
struct sctp_asconf_addrv4_param *fii; struct sctp_asconf_addrv4_param *fii;
#endif #endif
if (stcb->asoc.asconf_supported == 0) { if (stcb->asoc.asconf_supported == 0) {