Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jul 2018 16:23:27 -0400
From:      Michael Tuexen <tuexen@freebsd.org>
To:        cem@freebsd.org
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r336503 - in head/sys: netinet netinet6
Message-ID:  <F9ECD259-049F-45FB-A104-678749564BCC@freebsd.org>
In-Reply-To: <CAG6CVpWMWAZW_K47X1kXFS-JJo8Nc3zewKCzjRb7tr5BUsRAUA@mail.gmail.com>
References:  <201807191933.w6JJXhof018383@repo.freebsd.org> <CAG6CVpWMWAZW_K47X1kXFS-JJo8Nc3zewKCzjRb7tr5BUsRAUA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> On 19. Jul 2018, at 16:11, Conrad Meyer <cem@freebsd.org> wrote:
>=20
> These changes mostly seem like style regressions, rather than
> improvements.  (Not to mention, largescale churn like this makes it
> more difficult for future readers to research history (confusing tools
> like "git/svn blame").)
We have upstream code and run this to an formatter tool which depends
on ident, which has been changed recently. Unfortunately, I also ran
an older version of the script, so I reverted this in
https://svnweb.freebsd.org/changeset/base/336508
and committed a version really only showing the differences related to
the ident changes in
https://svnweb.freebsd.org/changeset/base/336511

Sorry for the noise!

Best regards
Michael
>=20
> On Thu, Jul 19, 2018 at 12:33 PM, Michael Tuexen <tuexen@freebsd.org> =
wrote:
>> Author: tuexen
>> Date: Thu Jul 19 19:33:42 2018
>> New Revision: 336503
>> URL: https://svnweb.freebsd.org/changeset/base/336503
>>=20
>> Log:
>>  Whitespace changes due to change if ident.
>>=20
>> Modified:
>>  head/sys/netinet/sctp.h
>>  head/sys/netinet/sctp_asconf.c
>>  head/sys/netinet/sctp_asconf.h
>>  head/sys/netinet/sctp_auth.c
>>  head/sys/netinet/sctp_auth.h
>>  head/sys/netinet/sctp_bsd_addr.c
>>  head/sys/netinet/sctp_bsd_addr.h
>>  head/sys/netinet/sctp_cc_functions.c
>>  head/sys/netinet/sctp_crc32.c
>>  head/sys/netinet/sctp_header.h
>>  head/sys/netinet/sctp_indata.c
>>  head/sys/netinet/sctp_indata.h
>>  head/sys/netinet/sctp_input.c
>>  head/sys/netinet/sctp_input.h
>>  head/sys/netinet/sctp_output.c
>>  head/sys/netinet/sctp_output.h
>>  head/sys/netinet/sctp_pcb.c
>>  head/sys/netinet/sctp_pcb.h
>>  head/sys/netinet/sctp_peeloff.c
>>  head/sys/netinet/sctp_ss_functions.c
>>  head/sys/netinet/sctp_structs.h
>>  head/sys/netinet/sctp_sysctl.c
>>  head/sys/netinet/sctp_timer.c
>>  head/sys/netinet/sctp_uio.h
>>  head/sys/netinet/sctp_usrreq.c
>>  head/sys/netinet/sctp_var.h
>>  head/sys/netinet/sctputil.c
>>  head/sys/netinet/sctputil.h
>>  head/sys/netinet6/sctp6_usrreq.c
>>  head/sys/netinet6/sctp6_var.h
>>=20
>> Modified: head/sys/netinet/sctp.h
>> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
>> --- head/sys/netinet/sctp.h     Thu Jul 19 19:32:08 2018        =
(r336502)
>> +++ head/sys/netinet/sctp.h     Thu Jul 19 19:33:42 2018        =
(r336503)
>> @@ -419,7 +419,7 @@ struct sctp_error_unresolv_addr {
>>=20
>> struct sctp_error_unrecognized_chunk {
>>        struct sctp_error_cause cause;  /* =
code=3DSCTP_CAUSE_UNRECOG_CHUNK */
>> -       struct sctp_chunkhdr ch;/* header from chunk in error */
>> +       struct sctp_chunkhdr ch;        /* header from chunk in error =
*/
>> }                             SCTP_PACKED;
>>=20
>> struct sctp_error_no_user_data {
>>=20
>> Modified: head/sys/netinet/sctp_asconf.c
>> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
>> --- head/sys/netinet/sctp_asconf.c      Thu Jul 19 19:32:08 2018      =
  (r336502)
>> +++ head/sys/netinet/sctp_asconf.c      Thu Jul 19 19:33:42 2018      =
  (r336503)
>> @@ -99,7 +99,7 @@ sctp_asconf_success_response(uint32_t id)
>> }
>>=20
>> static struct mbuf *
>> -sctp_asconf_error_response(uint32_t id, uint16_t cause, uint8_t =
*error_tlv,
>> +sctp_asconf_error_response(uint32_t id, uint16_t cause, uint8_t * =
error_tlv,
>>     uint16_t tlv_length)
>> {
>>        struct mbuf *m_reply =3D NULL;
>> @@ -134,7 +134,7 @@ sctp_asconf_error_response(uint32_t id, uint16_t =
cause
>>                return (NULL);
>>        }
>>        if (error_tlv !=3D NULL) {
>> -               tlv =3D (uint8_t *)(error + 1);
>> +               tlv =3D (uint8_t *) (error + 1);
>>                memcpy(tlv, error_tlv, tlv_length);
>>        }
>>        SCTP_BUF_LEN(m_reply) =3D aph->ph.param_length;
>> @@ -224,7 +224,7 @@ sctp_process_asconf_add_ip(struct sockaddr *src, =
struc
>> #endif
>>        default:
>>                m_reply =3D =
sctp_asconf_error_response(aph->correlation_id,
>> -                   SCTP_CAUSE_INVALID_PARAM, (uint8_t *)aph,
>> +                   SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph,
>>                    aparam_length);
>>                return (m_reply);
>>        }                       /* end switch */
>> @@ -239,7 +239,7 @@ sctp_process_asconf_add_ip(struct sockaddr *src, =
struc
>>        /* add the address */
>>        if (bad_address) {
>>                m_reply =3D =
sctp_asconf_error_response(aph->correlation_id,
>> -                   SCTP_CAUSE_INVALID_PARAM, (uint8_t *)aph,
>> +                   SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph,
>>                    aparam_length);
>>        } else if (sctp_add_remote_addr(stcb, sa, &net, =
stcb->asoc.port,
>>                    SCTP_DONOT_SETSCOPE,
>> @@ -247,7 +247,7 @@ sctp_process_asconf_add_ip(struct sockaddr *src, =
struc
>>                SCTPDBG(SCTP_DEBUG_ASCONF1,
>>                    "process_asconf_add_ip: error adding address\n");
>>                m_reply =3D =
sctp_asconf_error_response(aph->correlation_id,
>> -                   SCTP_CAUSE_RESOURCE_SHORTAGE, (uint8_t *)aph,
>> +                   SCTP_CAUSE_RESOURCE_SHORTAGE, (uint8_t *) aph,
>>                    aparam_length);
>>        } else {
>>                /* notify upper layer */
>> @@ -277,6 +277,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 !=3D src_net) {
>> @@ -369,7 +370,7 @@ sctp_process_asconf_delete_ip(struct sockaddr =
*src,
>> #endif
>>        default:
>>                m_reply =3D =
sctp_asconf_error_response(aph->correlation_id,
>> -                   SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *)aph,
>> +                   SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph,
>>                    aparam_length);
>>                return (m_reply);
>>        }
>> @@ -379,10 +380,11 @@ sctp_process_asconf_delete_ip(struct sockaddr =
*src,
>>                /* trying to delete the source address! */
>>                SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_delete_ip: =
tried to delete source addr\n");
>>                m_reply =3D =
sctp_asconf_error_response(aph->correlation_id,
>> -                   SCTP_CAUSE_DELETING_SRC_ADDR, (uint8_t *)aph,
>> +                   SCTP_CAUSE_DELETING_SRC_ADDR, (uint8_t *) aph,
>>                    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 =3D sctp_asconf_del_remote_addrs_except(stcb, =
src);
>> @@ -393,7 +395,7 @@ sctp_process_asconf_delete_ip(struct sockaddr =
*src,
>>                        /* what error to reply with?? */
>>                        m_reply =3D
>>                            =
sctp_asconf_error_response(aph->correlation_id,
>> -                           SCTP_CAUSE_REQUEST_REFUSED, (uint8_t =
*)aph,
>> +                           SCTP_CAUSE_REQUEST_REFUSED, (uint8_t *) =
aph,
>>                            aparam_length);
>>                } else if (response_required) {
>>                        m_reply =3D
>> @@ -401,6 +403,7 @@ sctp_process_asconf_delete_ip(struct sockaddr =
*src,
>>                }
>>                return (m_reply);
>>        }
>> +
>>        /* delete the address */
>>        result =3D sctp_del_remote_addr(stcb, sa);
>>        /*
>> @@ -412,7 +415,7 @@ sctp_process_asconf_delete_ip(struct sockaddr =
*src,
>>                /* only one address in the asoc */
>>                SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_delete_ip: =
tried to delete last IP addr!\n");
>>                m_reply =3D =
sctp_asconf_error_response(aph->correlation_id,
>> -                   SCTP_CAUSE_DELETING_LAST_ADDR, (uint8_t *)aph,
>> +                   SCTP_CAUSE_DELETING_LAST_ADDR, (uint8_t *) aph,
>>                    aparam_length);
>>        } else {
>>                if (response_required) {
>> @@ -494,7 +497,7 @@ sctp_process_asconf_set_primary(struct sockaddr =
*src,
>> #endif
>>        default:
>>                m_reply =3D =
sctp_asconf_error_response(aph->correlation_id,
>> -                   SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *)aph,
>> +                   SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph,
>>                    aparam_length);
>>                return (m_reply);
>>        }
>> @@ -565,7 +568,7 @@ sctp_process_asconf_set_primary(struct sockaddr =
*src,
>>                    "process_asconf_set_primary: set primary =
failed!\n");
>>                /* must have been an invalid address, so report */
>>                m_reply =3D =
sctp_asconf_error_response(aph->correlation_id,
>> -                   SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *)aph,
>> +                   SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph,
>>                    aparam_length);
>>        }
>>=20
>> @@ -616,6 +619,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 =3D serial_num;       /* update sequence =
*/
>>        /* get length of all the param's in the ASCONF */
>> @@ -640,6 +644,7 @@ sctp_handle_asconf(struct mbuf *m, unsigned int =
offset
>>                        =
SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_asconf_ack), ack);
>>                }
>>        }
>> +
>>        m_ack =3D sctp_get_mbuf_for_msg(sizeof(struct =
sctp_asconf_ack_chunk), 0,
>>            M_NOWAIT, 1, MT_DATA);
>>        if (m_ack =3D=3D NULL) {
>> @@ -660,7 +665,7 @@ sctp_handle_asconf(struct mbuf *m, unsigned int =
offset
>>=20
>>        /* skip the lookup address parameter */
>>        offset +=3D sizeof(struct sctp_asconf_chunk);
>> -       p_addr =3D (struct sctp_ipv6addr_param *)sctp_m_getptr(m, =
offset, sizeof(struct sctp_paramhdr), (uint8_t *)&aparam_buf);
>> +       p_addr =3D (struct sctp_ipv6addr_param *)sctp_m_getptr(m, =
offset, sizeof(struct sctp_paramhdr), (uint8_t *) & aparam_buf);
>>        if (p_addr =3D=3D NULL) {
>>                SCTPDBG(SCTP_DEBUG_ASCONF1,
>>                    "handle_asconf: couldn't get lookup addr!\n");
>> @@ -670,7 +675,7 @@ sctp_handle_asconf(struct mbuf *m, unsigned int =
offset
>>        /* param_length is already validated in process_control... */
>>        offset +=3D ntohs(p_addr->ph.param_length);       /* skip =
lookup addr */
>>        /* get pointer to first asconf param in ASCONF */
>> -       aph =3D (struct sctp_asconf_paramhdr *)sctp_m_getptr(m, =
offset, sizeof(struct sctp_asconf_paramhdr), (uint8_t *)&aparam_buf);
>> +       aph =3D (struct sctp_asconf_paramhdr *)sctp_m_getptr(m, =
offset, sizeof(struct sctp_asconf_paramhdr), (uint8_t *) & aparam_buf);
>>        if (aph =3D=3D NULL) {
>>                SCTPDBG(SCTP_DEBUG_ASCONF1, "Empty ASCONF =
received?\n");
>>                goto send_reply;
>> @@ -767,7 +772,7 @@ sctp_handle_asconf(struct mbuf *m, unsigned int =
offset
>>                /* get pointer to next asconf param */
>>                aph =3D (struct sctp_asconf_paramhdr =
*)sctp_m_getptr(m, offset,
>>                    sizeof(struct sctp_asconf_paramhdr),
>> -                   (uint8_t *)&aparam_buf);
>> +                   (uint8_t *) & aparam_buf);
>>                if (aph =3D=3D NULL) {
>>                        /* can't get an asconf paramhdr */
>>                        SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: =
can't get asconf param hdr!\n");
>> @@ -816,8 +821,7 @@ send_reply:
>>  * does the address match? returns 0 if not, 1 if so
>>  */
>> static uint32_t
>> -sctp_asconf_addr_match(struct sctp_asconf_addr *aa, struct sockaddr =
*sa)
>> -{
>> +sctp_asconf_addr_match(struct sctp_asconf_addr *aa, struct sockaddr =
*sa){
>>        switch (sa->sa_family) {
>> #ifdef INET6
>>        case AF_INET6:
>> @@ -856,8 +860,7 @@ sctp_asconf_addr_match(struct sctp_asconf_addr =
*aa, st
>>  * does the address match? returns 0 if not, 1 if so
>>  */
>> static uint32_t
>> -sctp_addr_match(struct sctp_paramhdr *ph, struct sockaddr *sa)
>> -{
>> +sctp_addr_match(struct sctp_paramhdr *ph, struct sockaddr *sa){
>> #if defined(INET) || defined(INET6)
>>        uint16_t param_type, param_length;
>>=20
>> @@ -974,6 +977,7 @@ sctp_assoc_immediate_retrans(struct sctp_tcb =
*stcb, st
>>        if (stcb->asoc.deleted_primary =3D=3D 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);
>> @@ -1077,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 */
>> @@ -1096,7 +1101,7 @@ sctp_path_check_and_react(struct sctp_tcb =
*stcb, struc
>>                 * NOT corresponding to the current nexthop, the path =
will
>>                 * not be changed.
>>                 */
>> -               SCTP_RTALLOC((sctp_route_t *)&net->ro,
>> +               SCTP_RTALLOC((sctp_route_t *) & net->ro,
>>                    stcb->sctp_ep->def_vrf_id,
>>                    stcb->sctp_ep->fibnum);
>>                if (net->ro.ro_rt =3D=3D NULL)
>> @@ -1106,7 +1111,7 @@ sctp_path_check_and_react(struct sctp_tcb =
*stcb, struc
>>                switch (net->ro._l_addr.sa.sa_family) {
>> #ifdef INET
>>                case AF_INET:
>> -                       if (sctp_v4src_match_nexthop(newifa, =
(sctp_route_t *)&net->ro)) {
>> +                       if (sctp_v4src_match_nexthop(newifa, =
(sctp_route_t *) & net->ro)) {
>>                                changed =3D 1;
>>                        }
>>                        break;
>> @@ -1114,7 +1119,7 @@ sctp_path_check_and_react(struct sctp_tcb =
*stcb, struc
>> #ifdef INET6
>>                case AF_INET6:
>>                        if (sctp_v6src_match_nexthop(
>> -                           &newifa->address.sin6, (sctp_route_t =
*)&net->ro)) {
>> +                           &newifa->address.sin6, (sctp_route_t *) & =
net->ro)) {
>>                                changed =3D 1;
>>                        }
>>                        break;
>> @@ -1323,6 +1328,7 @@ sctp_asconf_queue_add(struct sctp_tcb *stcb, =
struct sc
>>        if (stcb->asoc.asconf_supported =3D=3D 0) {
>>                return (-1);
>>        }
>> +
>>        /*
>>         * if this is deleting the last address from the assoc, mark =
it as
>>         * pending.
>> @@ -1343,6 +1349,7 @@ sctp_asconf_queue_add(struct sctp_tcb *stcb, =
struct sc
>>                        return (-1);
>>                }
>>        }
>> +
>>        /* queue an asconf parameter */
>>        status =3D sctp_asconf_queue_mgmt(stcb, ifa, type);
>>=20
>> @@ -1364,6 +1371,7 @@ sctp_asconf_queue_add(struct sctp_tcb *stcb, =
struct sc
>>                        stcb->asoc.asconf_addr_del_pending =3D NULL;
>>                }
>>        }
>> +
>>        if (pending_delete_queued) {
>>                struct sctp_nets *net;
>>=20
>> @@ -1388,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 =
*/
>> @@ -1685,11 +1694,13 @@ sctp_handle_asconf_ack(struct mbuf *m, int =
offset,
>>                    serial_num, asoc->asconf_seq_out_acked + 1);
>>                return;
>>        }
>> +
>>        if (serial_num =3D=3D 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 =3D ntohs(cp->ch.chunk_length) -
>>            sizeof(struct sctp_asconf_ack_chunk);
>> @@ -1778,7 +1789,7 @@ sctp_handle_asconf_ack(struct mbuf *m, int =
offset,
>>         * at any given time
>>         */
>>        if (last_error_id =3D=3D 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 =3D=3D 1) {
>>                        /*
>> @@ -1818,8 +1829,7 @@ sctp_handle_asconf_ack(struct mbuf *m, int =
offset,
>>=20
>> #ifdef INET6
>> static uint32_t
>> -sctp_is_scopeid_in_nets(struct sctp_tcb *stcb, struct sockaddr *sa)
>> -{
>> +sctp_is_scopeid_in_nets(struct sctp_tcb *stcb, struct sockaddr *sa){
>>        struct sockaddr_in6 *sin6, *net6;
>>        struct sctp_nets *net;
>>=20
>> @@ -2058,6 +2068,7 @@ sctp_asconf_iterator_ep_end(struct sctp_inpcb =
*inp, vo
>>                                        laddr->action =3D 0;
>>                                        break;
>>                                }
>> +
>>                        }
>>                } else if (l->action =3D=3D SCTP_DEL_IP_ADDRESS) {
>>                        LIST_FOREACH_SAFE(laddr, &inp->sctp_addr_list, =
sctp_nxt_addr, nladdr) {
>> @@ -2091,6 +2102,7 @@ sctp_asconf_iterator_stcb(struct sctp_inpcb =
*inp, stru
>>                if (ifa->vrf_id !=3D stcb->asoc.vrf_id) {
>>                        continue;
>>                }
>> +
>>                /* Same checks again for assoc */
>>                switch (ifa->address.sa.sa_family) {
>> #ifdef INET6
>> @@ -2269,8 +2281,7 @@ sctp_asconf_iterator_end(void *ptr, uint32_t =
val SCTP_
>>  * returns: 0 =3D completed, -1 =3D error
>>  */
>> int32_t
>> -sctp_set_primary_ip_address_sa(struct sctp_tcb *stcb, struct =
sockaddr *sa)
>> -{
>> +sctp_set_primary_ip_address_sa(struct sctp_tcb *stcb, struct =
sockaddr *sa){
>>        uint32_t vrf_id;
>>        struct sctp_ifa *ifa;
>>=20
>> @@ -2281,6 +2292,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 */
>> @@ -2359,11 +2371,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 =3D (struct sctp_asconf_paramhdr =
*)sctp_m_getptr(chk->data, offset, param_length, aparam_buf);
>>                        if (aph =3D=3D NULL) {
>>                                SCTPDBG(SCTP_DEBUG_ASCONF1, =
"is_addr_pending: couldn't get entire param\n");
>>                                break;
>>                        }
>> +
>>                        ph =3D (struct sctp_paramhdr *)(aph + 1);
>>                        if (sctp_addr_match(ph, &sctp_ifa->address.sa) =
!=3D 0) {
>>                                switch (param_type) {
>> @@ -2378,6 +2392,7 @@ sctp_is_addr_pending(struct sctp_tcb *stcb, =
struct sct
>>                                }
>>                                last_param_type =3D param_type;
>>                        }
>> +
>>                        offset +=3D SCTP_SIZE32(param_length);
>>                        if (offset >=3D asconf_limit) {
>>                                /* no more data in the mbuf chain */
>> @@ -2461,6 +2476,7 @@ sctp_find_valid_localaddr(struct sctp_tcb =
*stcb, int a
>>                                        if (sctp_ifa->localifa_flags & =
SCTP_ADDR_IFA_UNUSEABLE) {
>>                                                continue;
>>                                        }
>> +
>>                                        sin6 =3D =
&sctp_ifa->address.sin6;
>>                                        if =
(IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
>>                                                /*
>> @@ -2754,7 +2770,7 @@ sctp_process_initack_addresses(struct sctp_tcb =
*stcb,
>>        /* go through the addresses in the init-ack */
>>        ph =3D (struct sctp_paramhdr *)
>>            sctp_m_getptr(m, offset, sizeof(struct sctp_paramhdr),
>> -           (uint8_t *)&tmp_param);
>> +           (uint8_t *) & tmp_param);
>>        while (ph !=3D NULL) {
>>                ptype =3D ntohs(ph->param_type);
>>                plen =3D ntohs(ph->param_length);
>> @@ -2768,7 +2784,7 @@ sctp_process_initack_addresses(struct sctp_tcb =
*stcb,
>>                                a6p =3D (struct sctp_ipv6addr_param *)
>>                                    sctp_m_getptr(m, offset,
>>                                    sizeof(struct =
sctp_ipv6addr_param),
>> -                                   (uint8_t *)&addr6_store);
>> +                                   (uint8_t *) & addr6_store);
>>                                if (plen !=3D sizeof(struct =
sctp_ipv6addr_param) ||
>>                                    a6p =3D=3D NULL) {
>>                                        return;
>> @@ -2789,7 +2805,7 @@ sctp_process_initack_addresses(struct sctp_tcb =
*stcb,
>>                                /* get the entire IPv4 address param =
*/
>>                                a4p =3D (struct sctp_ipv4addr_param =
*)sctp_m_getptr(m, offset,
>>                                    sizeof(struct =
sctp_ipv4addr_param),
>> -                                   (uint8_t *)&addr4_store);
>> +                                   (uint8_t *) & addr4_store);
>>                                if (plen !=3D sizeof(struct =
sctp_ipv4addr_param) ||
>>                                    a4p =3D=3D NULL) {
>>                                        return;
>> @@ -2836,6 +2852,7 @@ sctp_process_initack_addresses(struct sctp_tcb =
*stcb,
>>                                }
>>                        }
>>                }
>> +
>> next_addr:
>>                /*
>>                 * Sanity check:  Make sure the length isn't 0, =
otherwise
>> @@ -2851,7 +2868,7 @@ next_addr:
>>                if ((offset + sizeof(struct sctp_paramhdr)) > length)
>>                        return;
>>                ph =3D (struct sctp_paramhdr *)sctp_m_getptr(m, =
offset,
>> -                   sizeof(struct sctp_paramhdr), (uint8_t =
*)&tmp_param);
>> +                   sizeof(struct sctp_paramhdr), (uint8_t *) & =
tmp_param);
>>        }                       /* while */
>> }
>>=20
>> @@ -2861,8 +2878,7 @@ next_addr:
>>  * 1 if found, 0 if not
>>  */
>> static uint32_t
>> -sctp_addr_in_initack(struct mbuf *m, uint32_t offset, uint32_t =
length, struct sockaddr *sa)
>> -{
>> +sctp_addr_in_initack(struct mbuf *m, uint32_t offset, uint32_t =
length, struct sockaddr *sa){
>>        struct sctp_paramhdr tmp_param, *ph;
>>        uint16_t plen, ptype;
>> #ifdef INET
>> @@ -2902,7 +2918,7 @@ sctp_addr_in_initack(struct mbuf *m, uint32_t =
offset,
>>        }
>>        /* go through the addresses in the init-ack */
>>        ph =3D (struct sctp_paramhdr *)sctp_m_getptr(m, offset,
>> -           sizeof(struct sctp_paramhdr), (uint8_t *)&tmp_param);
>> +           sizeof(struct sctp_paramhdr), (uint8_t *) & tmp_param);
>>        while (ph !=3D NULL) {
>>                ptype =3D ntohs(ph->param_type);
>>                plen =3D ntohs(ph->param_length);
>> @@ -2918,7 +2934,7 @@ sctp_addr_in_initack(struct mbuf *m, uint32_t =
offset,
>>                                a6p =3D (struct sctp_ipv6addr_param *)
>>                                    sctp_m_getptr(m, offset,
>>                                    sizeof(struct =
sctp_ipv6addr_param),
>> -                                   (uint8_t *)&addr6_store);
>> +                                   (uint8_t *) & addr6_store);
>>                                if (a6p =3D=3D NULL) {
>>                                        return (0);
>>                                }
>> @@ -2948,7 +2964,7 @@ sctp_addr_in_initack(struct mbuf *m, uint32_t =
offset,
>>                                a4p =3D (struct sctp_ipv4addr_param *)
>>                                    sctp_m_getptr(m, offset,
>>                                    sizeof(struct =
sctp_ipv4addr_param),
>> -                                   (uint8_t *)&addr4_store);
>> +                                   (uint8_t *) & addr4_store);
>>                                if (a4p =3D=3D NULL) {
>>                                        return (0);
>>                                }
>> @@ -2970,7 +2986,7 @@ sctp_addr_in_initack(struct mbuf *m, uint32_t =
offset,
>>                }
>>                ph =3D (struct sctp_paramhdr *)
>>                    sctp_m_getptr(m, offset, sizeof(struct =
sctp_paramhdr),
>> -                   (uint8_t *)&tmp_param);
>> +                   (uint8_t *) & tmp_param);
>>        }                       /* while */
>>        /* not found! */
>>        return (0);
>> @@ -3141,8 +3157,7 @@ sctp_check_address_list(struct sctp_tcb *stcb, =
struct
>>  */
>> uint32_t
>> sctp_addr_mgmt_ep_sa(struct sctp_inpcb *inp, struct sockaddr *sa,
>> -    uint32_t type, uint32_t vrf_id, struct sctp_ifa *sctp_ifap)
>> -{
>> +    uint32_t type, uint32_t vrf_id, struct sctp_ifa *sctp_ifap){
>>        struct sctp_ifa *ifa;
>>        struct sctp_laddr *laddr, *nladdr;
>>=20
>> @@ -3370,6 +3385,7 @@ sctp_asconf_send_nat_state_update(struct =
sctp_tcb *stc
>>                if (vrf =3D=3D 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) {
>>=20
>> Modified: head/sys/netinet/sctp_asconf.h
>> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
>> --- head/sys/netinet/sctp_asconf.h      Thu Jul 19 19:32:08 2018      =
  (r336502)
>> +++ head/sys/netinet/sctp_asconf.h      Thu Jul 19 19:33:42 2018      =
  (r336503)
>> @@ -60,10 +60,10 @@ sctp_addr_mgmt_ep_sa(struct sctp_inpcb *, struct =
socka
>>     uint32_t, uint32_t, struct sctp_ifa *);
>>=20
>>=20
>> -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);
>>=20
>> Modified: head/sys/netinet/sctp_auth.c
>> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
>> --- head/sys/netinet/sctp_auth.c        Thu Jul 19 19:32:08 2018      =
  (r336502)
>> +++ head/sys/netinet/sctp_auth.c        Thu Jul 19 19:33:42 2018      =
  (r336503)
>> @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$");
>>=20
>>=20
>> void
>> -sctp_clear_chunklist(sctp_auth_chklist_t *chklist)
>> +sctp_clear_chunklist(sctp_auth_chklist_t * chklist)
>> {
>>        memset(chklist, 0, sizeof(*chklist));
>>        /* chklist->num_chunks =3D 0; */
>> @@ -75,14 +75,14 @@ sctp_alloc_chunklist(void)
>> }
>>=20
>> void
>> -sctp_free_chunklist(sctp_auth_chklist_t *list)
>> +sctp_free_chunklist(sctp_auth_chklist_t * list)
>> {
>>        if (list !=3D NULL)
>>                SCTP_FREE(list, SCTP_M_AUTH_CL);
>> }
>>=20
>> sctp_auth_chklist_t *
>> -sctp_copy_chunklist(sctp_auth_chklist_t *list)
>> +sctp_copy_chunklist(sctp_auth_chklist_t * list)
>> {
>>        sctp_auth_chklist_t *new_list;
>>=20
>> @@ -104,7 +104,7 @@ sctp_copy_chunklist(sctp_auth_chklist_t *list)
>>  * add a chunk to the required chunks list
>>  */
>> int
>> -sctp_auth_add_chunk(uint8_t chunk, sctp_auth_chklist_t *list)
>> +sctp_auth_add_chunk(uint8_t chunk, sctp_auth_chklist_t * list)
>> {
>>        if (list =3D=3D NULL)
>>                return (-1);
>> @@ -130,7 +130,7 @@ sctp_auth_add_chunk(uint8_t chunk, =
sctp_auth_chklist_t
>>  * delete a chunk from the required chunks list
>>  */
>> int
>> -sctp_auth_delete_chunk(uint8_t chunk, sctp_auth_chklist_t *list)
>> +sctp_auth_delete_chunk(uint8_t chunk, sctp_auth_chklist_t * list)
>> {
>>        if (list =3D=3D NULL)
>>                return (-1);
>> @@ -146,7 +146,7 @@ sctp_auth_delete_chunk(uint8_t chunk, =
sctp_auth_chklis
>> }
>>=20
>> size_t
>> -sctp_auth_get_chklist_size(const sctp_auth_chklist_t *list)
>> +sctp_auth_get_chklist_size(const sctp_auth_chklist_t * list)
>> {
>>        if (list =3D=3D NULL)
>>                return (0);
>> @@ -159,7 +159,7 @@ sctp_auth_get_chklist_size(const =
sctp_auth_chklist_t *
>>  * guarantee ptr has space for up to 256 bytes
>>  */
>> int
>> -sctp_serialize_auth_chunks(const sctp_auth_chklist_t *list, uint8_t =
*ptr)
>> +sctp_serialize_auth_chunks(const sctp_auth_chklist_t * list, uint8_t =
* ptr)
>> {
>>        int i, count =3D 0;
>>=20
>> @@ -176,7 +176,7 @@ sctp_serialize_auth_chunks(const =
sctp_auth_chklist_t *
>> }
>>=20
>> int
>> -sctp_pack_auth_chunks(const sctp_auth_chklist_t *list, uint8_t *ptr)
>> +sctp_pack_auth_chunks(const sctp_auth_chklist_t * list, uint8_t * =
ptr)
>> {
>>        int i, size =3D 0;
>>=20
>> @@ -208,8 +208,8 @@ sctp_pack_auth_chunks(const sctp_auth_chklist_t =
*list,
>> }
>>=20
>> int
>> -sctp_unpack_auth_chunks(const uint8_t *ptr, uint8_t num_chunks,
>> -    sctp_auth_chklist_t *list)
>> +sctp_unpack_auth_chunks(const uint8_t * ptr, uint8_t num_chunks,
>> +    sctp_auth_chklist_t * list)
>> {
>>        int i;
>>        int size;
>> @@ -259,14 +259,14 @@ sctp_alloc_key(uint32_t keylen)
>> }
>>=20
>> void
>> -sctp_free_key(sctp_key_t *key)
>> +sctp_free_key(sctp_key_t * key)
>> {
>>        if (key !=3D NULL)
>>                SCTP_FREE(key, SCTP_M_AUTH_KY);
>> }
>>=20
>> void
>> -sctp_print_key(sctp_key_t *key, const char *str)
>> +sctp_print_key(sctp_key_t * key, const char *str)
>> {
>>        uint32_t i;
>>=20
>> @@ -285,7 +285,7 @@ sctp_print_key(sctp_key_t *key, const char *str)
>> }
>>=20
>> void
>> -sctp_show_key(sctp_key_t *key, const char *str)
>> +sctp_show_key(sctp_key_t * key, const char *str)
>> {
>>        uint32_t i;
>>=20
>> @@ -304,8 +304,7 @@ sctp_show_key(sctp_key_t *key, const char *str)
>> }
>>=20
>> static uint32_t
>> -sctp_get_keylen(sctp_key_t *key)
>> -{
>> +sctp_get_keylen(sctp_key_t * key) {
>>        if (key !=3D NULL)
>>                return (key->keylen);
>>        else
>> @@ -331,7 +330,7 @@ sctp_generate_random_key(uint32_t keylen)
>> }
>>=20
>> sctp_key_t *
>> -sctp_set_key(uint8_t *key, uint32_t keylen)
>> +sctp_set_key(uint8_t * key, uint32_t keylen)
>> {
>>        sctp_key_t *new_key;
>>=20
>> @@ -351,7 +350,7 @@ sctp_set_key(uint8_t *key, uint32_t keylen)
>>  *           0 if key1 =3D key2
>>  */
>> static int
>> -sctp_compare_key(sctp_key_t *key1, sctp_key_t *key2)
>> +sctp_compare_key(sctp_key_t * key1, sctp_key_t * key2)
>> {
>>        uint32_t maxlen;
>>        uint32_t i;
>> @@ -402,7 +401,7 @@ sctp_compare_key(sctp_key_t *key1, sctp_key_t =
*key2)
>>  * order for concatenation
>>  */
>> sctp_key_t *
>> -sctp_compute_hashkey(sctp_key_t *key1, sctp_key_t *key2, sctp_key_t =
*shared)
>> +sctp_compute_hashkey(sctp_key_t * key1, sctp_key_t * key2, =
sctp_key_t * shared)
>> {
>>        uint32_t keylen;
>>        sctp_key_t *new_key;
>> @@ -476,7 +475,7 @@ sctp_alloc_sharedkey(void)
>> }
>>=20
>> void
>> -sctp_free_sharedkey(sctp_sharedkey_t *skey)
>> +sctp_free_sharedkey(sctp_sharedkey_t * skey)
>> {
>>        if (skey =3D=3D NULL)
>>                return;
>> @@ -502,7 +501,7 @@ sctp_find_sharedkey(struct sctp_keyhead =
*shared_keys,
>>=20
>> int
>> sctp_insert_sharedkey(struct sctp_keyhead *shared_keys,
>> -    sctp_sharedkey_t *new_skey)
>> +    sctp_sharedkey_t * new_skey)
>> {
>>        sctp_sharedkey_t *skey;
>>=20
>> @@ -596,8 +595,7 @@ sctp_auth_key_release(struct sctp_tcb *stcb, =
uint16_t
>> }
>>=20
>> static sctp_sharedkey_t *
>> -sctp_copy_sharedkey(const sctp_sharedkey_t *skey)
>> -{
>> +sctp_copy_sharedkey(const sctp_sharedkey_t * skey){
>>        sctp_sharedkey_t *new_skey;
>>=20
>>        if (skey =3D=3D NULL)
>> @@ -654,7 +652,7 @@ sctp_alloc_hmaclist(uint16_t num_hmacs)
>> }
>>=20
>> void
>> -sctp_free_hmaclist(sctp_hmaclist_t *list)
>> +sctp_free_hmaclist(sctp_hmaclist_t * list)
>> {
>>        if (list !=3D NULL) {
>>                SCTP_FREE(list, SCTP_M_AUTH_HL);
>> @@ -663,7 +661,7 @@ sctp_free_hmaclist(sctp_hmaclist_t *list)
>> }
>>=20
>> int
>> -sctp_auth_add_hmacid(sctp_hmaclist_t *list, uint16_t hmac_id)
>> +sctp_auth_add_hmacid(sctp_hmaclist_t * list, uint16_t hmac_id)
>> {
>>        int i;
>>=20
>> @@ -691,7 +689,7 @@ sctp_auth_add_hmacid(sctp_hmaclist_t *list, =
uint16_t h
>> }
>>=20
>> sctp_hmaclist_t *
>> -sctp_copy_hmaclist(sctp_hmaclist_t *list)
>> +sctp_copy_hmaclist(sctp_hmaclist_t * list)
>> {
>>        sctp_hmaclist_t *new_list;
>>        int i;
>> @@ -729,8 +727,7 @@ sctp_default_supported_hmaclist(void)
>>  * find the best HMAC id to use for the peer based on local support
>>  */
>> uint16_t
>> -sctp_negotiate_hmacid(sctp_hmaclist_t *peer, sctp_hmaclist_t *local)
>> -{
>> +sctp_negotiate_hmacid(sctp_hmaclist_t * peer, sctp_hmaclist_t * =
local) {
>>        int i, j;
>>=20
>>        if ((local =3D=3D NULL) || (peer =3D=3D NULL))
>> @@ -756,7 +753,7 @@ sctp_negotiate_hmacid(sctp_hmaclist_t *peer, =
sctp_hmac
>>  * caller must guarantee ptr has appropriate space
>>  */
>> int
>> -sctp_serialize_hmaclist(sctp_hmaclist_t *list, uint8_t *ptr)
>> +sctp_serialize_hmaclist(sctp_hmaclist_t * list, uint8_t * ptr)
>> {
>>        int i;
>>        uint16_t hmac_id;
>> @@ -802,7 +799,7 @@ sctp_alloc_authinfo(void)
>> }
>>=20
>> void
>> -sctp_free_authinfo(sctp_authinfo_t *authinfo)
>> +sctp_free_authinfo(sctp_authinfo_t * authinfo)
>> {
>>        if (authinfo =3D=3D NULL)
>>                return;
>> @@ -822,8 +819,7 @@ sctp_free_authinfo(sctp_authinfo_t *authinfo)
>>=20
>>=20
>> uint32_t
>> -sctp_get_auth_chunk_len(uint16_t hmac_algo)
>> -{
>> +sctp_get_auth_chunk_len(uint16_t hmac_algo) {
>>        int size;
>>=20
>>        size =3D sizeof(struct sctp_auth_chunk) + =
sctp_get_hmac_digest_len(hmac_algo);
>> @@ -831,8 +827,7 @@ sctp_get_auth_chunk_len(uint16_t hmac_algo)
>> }
>>=20
>> uint32_t
>> -sctp_get_hmac_digest_len(uint16_t hmac_algo)
>> -{
>> +sctp_get_hmac_digest_len(uint16_t hmac_algo) {
>>        switch (hmac_algo) {
>>        case SCTP_AUTH_HMAC_ID_SHA1:
>>                return (SCTP_AUTH_DIGEST_LEN_SHA1);
>> @@ -860,7 +855,7 @@ sctp_get_hmac_block_len(uint16_t hmac_algo)
>> }
>>=20
>> static void
>> -sctp_hmac_init(uint16_t hmac_algo, sctp_hash_context_t *ctx)
>> +sctp_hmac_init(uint16_t hmac_algo, sctp_hash_context_t * ctx)
>> {
>>        switch (hmac_algo) {
>>        case SCTP_AUTH_HMAC_ID_SHA1:
>> @@ -877,8 +872,8 @@ sctp_hmac_init(uint16_t hmac_algo, =
sctp_hash_context_t
>> }
>>=20
>> static void
>> -sctp_hmac_update(uint16_t hmac_algo, sctp_hash_context_t *ctx,
>> -    uint8_t *text, uint32_t textlen)
>> +sctp_hmac_update(uint16_t hmac_algo, sctp_hash_context_t * ctx,
>> +    uint8_t * text, uint32_t textlen)
>> {
>>        switch (hmac_algo) {
>>        case SCTP_AUTH_HMAC_ID_SHA1:
>> @@ -895,8 +890,8 @@ sctp_hmac_update(uint16_t hmac_algo, =
sctp_hash_context
>> }
>>=20
>> static void
>> -sctp_hmac_final(uint16_t hmac_algo, sctp_hash_context_t *ctx,
>> -    uint8_t *digest)
>> +sctp_hmac_final(uint16_t hmac_algo, sctp_hash_context_t * ctx,
>> +    uint8_t * digest)
>> {
>>        switch (hmac_algo) {
>>        case SCTP_AUTH_HMAC_ID_SHA1:
>> @@ -923,9 +918,8 @@ sctp_hmac_final(uint16_t hmac_algo, =
sctp_hash_context_
>>  * resultant digest.
>>  */
>> uint32_t
>> -sctp_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t keylen,
>> -    uint8_t *text, uint32_t textlen, uint8_t *digest)
>> -{
>> +sctp_hmac(uint16_t hmac_algo, uint8_t * key, uint32_t keylen,
>> +    uint8_t * text, uint32_t textlen, uint8_t * digest) {
>>        uint32_t digestlen;
>>        uint32_t blocklen;
>>        sctp_hash_context_t ctx;
>> @@ -983,9 +977,8 @@ sctp_hmac(uint16_t hmac_algo, uint8_t *key, =
uint32_t k
>>=20
>> /* mbuf version */
>> 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)
>> -{
>> +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){
>>        uint32_t digestlen;
>>        uint32_t blocklen;
>>        sctp_hash_context_t ctx;
>> @@ -1031,17 +1024,17 @@ sctp_hmac_m(uint16_t hmac_algo, uint8_t *key, =
uint32_t
>>        sctp_hmac_update(hmac_algo, &ctx, ipad, blocklen);
>>        /* find the correct starting mbuf and offset (get start of =
text) */
>>        m_tmp =3D m;
>> -       while ((m_tmp !=3D NULL) && (m_offset >=3D =
(uint32_t)SCTP_BUF_LEN(m_tmp))) {
>> +       while ((m_tmp !=3D NULL) && (m_offset >=3D (uint32_t) =
SCTP_BUF_LEN(m_tmp))) {
>>                m_offset -=3D SCTP_BUF_LEN(m_tmp);
>>                m_tmp =3D SCTP_BUF_NEXT(m_tmp);
>>        }
>>        /* now use the rest of the mbuf chain for the text */
>>        while (m_tmp !=3D NULL) {
>>                if ((SCTP_BUF_NEXT(m_tmp) =3D=3D NULL) && trailer) {
>> -                       sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, =
uint8_t *)+m_offset,
>> +                       sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, =
uint8_t *) + m_offset,
>>                            SCTP_BUF_LEN(m_tmp) - (trailer + =
m_offset));
>>                } else {
>> -                       sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, =
uint8_t *)+m_offset,
>> +                       sctp_hmac_update(hmac_algo, &ctx, mtod(m_tmp, =
uint8_t *) + m_offset,
>>                            SCTP_BUF_LEN(m_tmp) - m_offset);
>>                }
>>=20
>> @@ -1066,9 +1059,9 @@ sctp_hmac_m(uint16_t hmac_algo, uint8_t *key, =
uint32_t
>>  * Returns -1 on error, 0 on success.
>>  */
>> 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)
>> +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)
>> {
>>        uint32_t len;
>>        uint8_t temp[SCTP_AUTH_DIGEST_LEN_MAX];
>> @@ -1099,9 +1092,8 @@ sctp_verify_hmac(uint16_t hmac_algo, uint8_t =
*key, uin
>>  * the keylen exceeds the HMAC block len).
>>  */
>> uint32_t
>> -sctp_compute_hmac(uint16_t hmac_algo, sctp_key_t *key, uint8_t =
*text,
>> -    uint32_t textlen, uint8_t *digest)
>> -{
>> +sctp_compute_hmac(uint16_t hmac_algo, sctp_key_t * key, uint8_t * =
text,
>> +    uint32_t textlen, uint8_t * digest) {
>>        uint32_t digestlen;
>>        uint32_t blocklen;
>>        sctp_hash_context_t ctx;
>> @@ -1134,9 +1126,8 @@ sctp_compute_hmac(uint16_t hmac_algo, =
sctp_key_t *key,
>>=20
>> /* mbuf version */
>> uint32_t
>> -sctp_compute_hmac_m(uint16_t hmac_algo, sctp_key_t *key, struct mbuf =
*m,
>> -    uint32_t m_offset, uint8_t *digest)
>> -{
>> +sctp_compute_hmac_m(uint16_t hmac_algo, sctp_key_t * key, struct =
mbuf *m,
>> +    uint32_t m_offset, uint8_t * digest){
>>        uint32_t digestlen;
>>        uint32_t blocklen;
>>        sctp_hash_context_t ctx;
>> @@ -1166,7 +1157,7 @@ sctp_compute_hmac_m(uint16_t hmac_algo, =
sctp_key_t *ke
>> }
>>=20
>> int
>> -sctp_auth_is_supported_hmac(sctp_hmaclist_t *list, uint16_t id)
>> +sctp_auth_is_supported_hmac(sctp_hmaclist_t * list, uint16_t id)
>> {
>>        int i;
>>=20
>> @@ -1309,6 +1300,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 =3D keyid;
>>        /* reset the deactivated flag */
>> @@ -1363,6 +1355,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 =3D 1;
>>=20
>> @@ -1424,7 +1417,7 @@ sctp_auth_get_cookie_params(struct sctp_tcb =
*stcb, str
>>        length +=3D offset;
>>=20
>>        phdr =3D (struct sctp_paramhdr *)sctp_m_getptr(m, offset,
>> -           sizeof(struct sctp_paramhdr), (uint8_t *)&tmp_param);
>> +           sizeof(struct sctp_paramhdr), (uint8_t *) & tmp_param);
>>        while (phdr !=3D NULL) {
>>                ptype =3D ntohs(phdr->param_type);
>>                plen =3D ntohs(phdr->param_length);
>> @@ -1491,7 +1484,7 @@ sctp_auth_get_cookie_params(struct sctp_tcb =
*stcb, str
>>                if (offset + sizeof(struct sctp_paramhdr) > length)
>>                        break;
>>                phdr =3D (struct sctp_paramhdr *)sctp_m_getptr(m, =
offset, sizeof(struct sctp_paramhdr),
>> -                   (uint8_t *)&tmp_param);
>> +                   (uint8_t *) & tmp_param);
>>        }
>>        /* concatenate the full random key */
>>        keylen =3D sizeof(*p_random) + random_len + sizeof(*hmacs) + =
hmacs_len;
>> @@ -1582,6 +1575,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 =3D htons(keyid);
>>=20
>> @@ -1603,14 +1597,14 @@ sctp_zero_m(struct mbuf *m, uint32_t =
m_offset, uint32_
>>=20
>>        /* find the correct starting mbuf and offset (get start =
position) */
>>        m_tmp =3D m;
>> -       while ((m_tmp !=3D NULL) && (m_offset >=3D =
(uint32_t)SCTP_BUF_LEN(m_tmp))) {
>> +       while ((m_tmp !=3D NULL) && (m_offset >=3D (uint32_t) =
SCTP_BUF_LEN(m_tmp))) {
>>                m_offset -=3D SCTP_BUF_LEN(m_tmp);
>>                m_tmp =3D SCTP_BUF_NEXT(m_tmp);
>>        }
>>        /* now use the rest of the mbuf chain */
>>        while ((m_tmp !=3D NULL) && (size > 0)) {
>> -               data =3D mtod(m_tmp, uint8_t *)+m_offset;
>> -               if (size > (uint32_t)(SCTP_BUF_LEN(m_tmp) - =
m_offset)) {
>> +               data =3D mtod(m_tmp, uint8_t *) + m_offset;
>> +               if (size > (uint32_t) (SCTP_BUF_LEN(m_tmp) - =
m_offset)) {
>>                        memset(data, 0, SCTP_BUF_LEN(m_tmp) - =
m_offset);
>>                        size -=3D SCTP_BUF_LEN(m_tmp) - m_offset;
>>                } else {
>> @@ -1769,6 +1763,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;
>> @@ -1929,6 +1924,7 @@ sctp_validate_init_auth_params(struct mbuf *m, =
int off
>>                        if (num_chunks)
>>                                got_chklist =3D 1;
>>                }
>> +
>>                offset +=3D SCTP_SIZE32(plen);
>>                if (offset >=3D limit) {
>>                        break;
>> @@ -2023,6 +2019,7 @@ sctp_initialize_auth_params(struct sctp_inpcb =
*inp, st
>>                                        new_key->key[keylen++] =3D i;
>>                        }
>>                }
>> +
>>                /* append in the HMACs */
>>                ph =3D (struct sctp_paramhdr *)(new_key->key + =
keylen);
>>                ph->param_type =3D htons(SCTP_HMAC_LIST);
>>=20
>> Modified: head/sys/netinet/sctp_auth.h
>> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
>> --- head/sys/netinet/sctp_auth.h        Thu Jul 19 19:32:08 2018      =
  (r336502)
>> +++ head/sys/netinet/sctp_auth.h        Thu Jul 19 19:33:42 2018      =
  (r336503)
>> @@ -53,12 +53,12 @@ __FBSDID("$FreeBSD$");
>> typedef union sctp_hash_context {
>>        SCTP_SHA1_CTX sha1;
>>        SCTP_SHA256_CTX sha256;
>> -} sctp_hash_context_t;
>> +}                 sctp_hash_context_t;
>>=20
>> typedef struct sctp_key {
>>        uint32_t keylen;
>>        uint8_t key[];
>> -} sctp_key_t;
>> +}        sctp_key_t;
>>=20
>> typedef struct sctp_shared_key {
>>        LIST_ENTRY(sctp_shared_key) next;
>> @@ -66,7 +66,7 @@ typedef struct sctp_shared_key {
>>        uint32_t refcount;      /* reference count */
>>        uint16_t keyid;         /* shared key ID */
>>        uint8_t deactivated;    /* key is deactivated */
>> -} sctp_sharedkey_t;
>> +}               sctp_sharedkey_t;
>>=20
>> LIST_HEAD(sctp_keyhead, sctp_shared_key);
>>=20
>> @@ -74,26 +74,26 @@ LIST_HEAD(sctp_keyhead, sctp_shared_key);
>> typedef struct sctp_auth_chklist {
>>        uint8_t chunks[256];
>>        uint8_t num_chunks;
>> -} sctp_auth_chklist_t;
>> +}                 sctp_auth_chklist_t;
>>=20
>> /* hmac algos supported list */
>> typedef struct sctp_hmaclist {
>>        uint16_t max_algo;      /* max algorithms allocated */
>>        uint16_t num_algo;      /* num algorithms used */
>>        uint16_t hmac[];
>> -} sctp_hmaclist_t;
>> +}             sctp_hmaclist_t;
>>=20
>> /* authentication info */
>> 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 */
>>        uint16_t assoc_keyid;   /* current send keyid (cached) */
>>        uint16_t recv_keyid;    /* last recv keyid (cached) */
>> -} sctp_authinfo_t;
>> +}                    sctp_authinfo_t;
>>=20
>> *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
>>=20
>=20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F9ECD259-049F-45FB-A104-678749564BCC>