From 4c7fb0cf6e3209b705eefe0cb57c01d9de255444 Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Thu, 13 Oct 2016 13:38:14 +0000 Subject: [PATCH] Whitespace changes. MFC after: 1 month --- sys/netinet/sctp_pcb.c | 128 ++++++++++++----------------------------- 1 file changed, 38 insertions(+), 90 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 90e564f07dcb..25ace695ff6d 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -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)); } - #endif void @@ -837,14 +836,11 @@ static int sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to) { int loopback_scope; - #if defined(INET) int ipv4_local_scope, ipv4_addr_legal; - #endif #if defined(INET6) int local_scope, site_scope, ipv6_addr_legal; - #endif struct sctp_vrf *vrf; struct sctp_ifn *sctp_ifn; @@ -1216,10 +1212,8 @@ sctp_tcb_special_locate(struct sctp_inpcb **inp_p, struct sockaddr *from, if (netp != NULL) { *netp = net; } - /* - * Update the endpoint - * pointer - */ + /* Update the endpoint + * pointer */ *inp_p = inp; SCTP_INP_RUNLOCK(inp); return (stcb); @@ -1240,10 +1234,8 @@ sctp_tcb_special_locate(struct sctp_inpcb **inp_p, struct sockaddr *from, if (netp != NULL) { *netp = net; } - /* - * Update the endpoint - * pointer - */ + /* Update the endpoint + * pointer */ *inp_p = inp; SCTP_INP_RUNLOCK(inp); return (stcb); @@ -1622,15 +1614,12 @@ sctp_endpoint_probe(struct sockaddr *nam, struct sctppcbhead *head, { struct sctp_inpcb *inp; struct sctp_laddr *laddr; - #ifdef INET struct sockaddr_in *sin; - #endif #ifdef INET6 struct sockaddr_in6 *sin6; struct sockaddr_in6 *intf_addr6; - #endif int fnd; @@ -1673,10 +1662,8 @@ sctp_endpoint_probe(struct sockaddr *nam, struct sctppcbhead *head, case AF_INET: if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && SCTP_IPV6_V6ONLY(inp)) { - /* - * IPv4 on a IPv6 socket with ONLY - * IPv6 set - */ + /* IPv4 on a IPv6 socket with ONLY + * IPv6 set */ SCTP_INP_RUNLOCK(inp); continue; } @@ -1689,10 +1676,8 @@ sctp_endpoint_probe(struct sockaddr *nam, struct sctppcbhead *head, #endif #ifdef INET6 case AF_INET6: - /* - * A V6 address and the endpoint is NOT - * bound V6 - */ + /* A V6 address and the endpoint is NOT + * bound V6 */ if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) { SCTP_INP_RUNLOCK(inp); continue; @@ -1926,14 +1911,11 @@ sctp_pcb_findep(struct sockaddr *nam, int find_tcp_pool, int have_lock, struct sctppcbhead *head; int lport; unsigned int i; - #ifdef INET struct sockaddr_in *sin; - #endif #ifdef INET6 struct sockaddr_in6 *sin6; - #endif switch (nam->sa_family) { @@ -2057,21 +2039,16 @@ sctp_findassociation_special_addr(struct mbuf *m, int offset, struct sockaddr *dst) { struct sctp_paramhdr *phdr, parm_buf; - #if defined(INET) || defined(INET6) struct sctp_tcb *stcb; uint16_t ptype; - #endif uint16_t plen; - #ifdef INET struct sockaddr_in sin4; - #endif #ifdef INET6 struct sockaddr_in6 sin6; - #endif #ifdef INET @@ -2198,10 +2175,8 @@ sctp_findassoc_by_vtag(struct sockaddr *from, struct sockaddr *to, uint32_t vtag continue; } if (remote_tag) { - /* - * If we have both vtags that's all we match - * on - */ + /* If we have both vtags that's all we match + * on */ if (stcb->asoc.peer_vtag == remote_tag) { /* * 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; int ptype; int zero_address = 0; - #ifdef INET struct sockaddr_in *sin; - #endif #ifdef INET6 struct sockaddr_in6 *sin6; - #endif memset(&remote_store, 0, sizeof(remote_store)); @@ -2897,10 +2869,8 @@ sctp_inpcb_bind(struct socket *so, struct sockaddr *addr, #ifdef INET6 case AF_INET6: { - /* - * Only for pure IPv6 Address. (No IPv4 - * Mapped!) - */ + /* Only for pure IPv6 Address. (No IPv4 + * Mapped!) */ struct sockaddr_in6 *sin6; sin6 = (struct sockaddr_in6 *)addr; @@ -2977,10 +2947,8 @@ sctp_inpcb_bind(struct socket *so, struct sockaddr *addr, /* unlock info */ if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE)) && (sctp_is_feature_on(inp_tmp, SCTP_PCB_FLAGS_PORTREUSE))) { - /* - * Ok, must be one-2-one and - * allowing port re-use - */ + /* Ok, must be one-2-one and + * allowing port re-use */ port_reuse_active = 1; goto continue_anyway; } @@ -3003,10 +2971,8 @@ sctp_inpcb_bind(struct socket *so, struct sockaddr *addr, /* unlock info */ if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE)) && (sctp_is_feature_on(inp_tmp, SCTP_PCB_FLAGS_PORTREUSE))) { - /* - * Ok, must be one-2-one and - * allowing port re-use - */ + /* Ok, must be one-2-one and + * allowing port re-use */ port_reuse_active = 1; goto continue_anyway; } @@ -3146,11 +3112,11 @@ continue_anyway: * bind specific, make sure flags is off and add a new * address structure to the sctp_addr_list inside the ep * structure. - * - * We will need to allocate one and insert it at the head. The - * socketopt call can just insert new addresses in there as - * well. It will also have to do the embed scope kame hack - * too (before adding). + * + * We will need to allocate one and insert it at the head. + * The socketopt call can just insert new addresses in there + * as well. It will also have to do the embed scope kame + * hack too (before adding). */ struct sctp_ifa *ifa; 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 * reference on the stcb and inp. We can mark it and it will * stop. - * - * If its a single iterator situation, we set the end iterator - * flag. Otherwise we set the iterator to go to the next - * inp. - * + * + * If its a single iterator situation, we set the end + * iterator flag. Otherwise we set the iterator to go to the + * next inp. + * */ if (it->iterator_flags & SCTP_ITERATOR_DO_SINGLE_INP) { 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); } } - /* - * When its put in the refcnt is incremented so decr - * it - */ + /* When its put in the refcnt is incremented so decr + * it */ 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); if (rmtu == 0) { - /* - * Start things off to match mtu of - * interface please. - */ + /* Start things off to match mtu of + * interface please. */ SCTP_SET_MTU_OF_ROUTE(&net->ro._l_addr.sa, net->ro.ro_rt, net->mtu); } 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) /* delete this address */ stcb->asoc.last_used_address = NULL; - /* - * Now spin through all the nets and purge any ref - * to laddr - */ + /* Now spin through all the nets and purge any ref + * to laddr */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { if (net->ro._s_addr == laddr->ifa) { /* Yep, purge src address selected */ @@ -5755,7 +5715,6 @@ sctp_startup_mcore_threads(void) } } - #endif 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_pktdrop; uint8_t peer_supports_idata; - #ifdef INET struct sockaddr_in sin; - #endif #ifdef INET6 struct sockaddr_in6 sin6; - #endif /* 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; char msg[SCTP_DIAG_INFO_LEN]; - /* - * in setup state we - * abort this guy - */ + /* in setup state we + * abort this guy */ snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); 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; } if (IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr)) { - /* - * Link local make no sense without - * scope - */ + /* Link local make no sense without + * scope */ goto next_param; } sa = (struct sockaddr *)&sin6; @@ -6366,10 +6318,8 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m, struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - /* - * in setup state we - * abort this guy - */ + /* in setup state we + * abort this guy */ snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); 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; int lptype; struct sockaddr *lsa = NULL; - #ifdef INET struct sctp_asconf_addrv4_param *fii; - #endif if (stcb->asoc.asconf_supported == 0) {