The branch main has been updated by tuexen:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f83db6441a2f4f925a169c7ddf844589cb73c9b5

commit f83db6441a2f4f925a169c7ddf844589cb73c9b5
Author:     Michael Tuexen <[email protected]>
AuthorDate: 2022-11-06 22:06:40 +0000
Commit:     Michael Tuexen <[email protected]>
CommitDate: 2022-11-06 22:06:40 +0000

    sctp: minor changes due to upstreaming of Glebs recent changes
---
 sys/netinet/sctp_pcb.c      |  2 ++
 sys/netinet/sctp_usrreq.c   | 27 +++++++++++++--------------
 sys/netinet/sctp_var.h      |  2 ++
 sys/netinet6/sctp6_usrreq.c | 28 ++++++++++++++--------------
 sys/netinet6/sctp6_var.h    |  2 +-
 5 files changed, 32 insertions(+), 29 deletions(-)

diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index 0fb92e7408f4..fa6ad102f864 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -6946,6 +6946,7 @@ static void
 sctp_drain(void)
 {
        struct epoch_tracker et;
+
        VNET_ITERATOR_DECL(vnet_iter);
 
        NET_EPOCH_ENTER(et);
@@ -6987,6 +6988,7 @@ sctp_drain(void)
        VNET_LIST_RUNLOCK_NOSLEEP();
        NET_EPOCH_EXIT(et);
 }
+
 EVENTHANDLER_DEFINE(vm_lowmem, sctp_drain, NULL, LOWMEM_PRI_DEFAULT);
 EVENTHANDLER_DEFINE(mbuf_lowmem, sctp_drain, NULL, LOWMEM_PRI_DEFAULT);
 
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c
index b06920529f44..d308b75aa90d 100644
--- a/sys/netinet/sctp_usrreq.c
+++ b/sys/netinet/sctp_usrreq.c
@@ -287,9 +287,9 @@ sctp_ctlinput(struct icmp *icmp)
        dst.sin_port = sh->dest_port;
        dst.sin_addr = inner_ip->ip_dst;
        /*
-        * 'dst' holds the dest of the packet that failed to be
-        * sent. 'src' holds our local endpoint address. Thus we
-        * reverse the dst and the src in the lookup.
+        * 'dst' holds the dest of the packet that failed to be sent. 'src'
+        * holds our local endpoint address. Thus we reverse the dst and the
+        * src in the lookup.
         */
        inp = NULL;
        net = NULL;
@@ -303,10 +303,9 @@ sctp_ctlinput(struct icmp *icmp)
                /* Check the verification tag */
                if (ntohl(sh->v_tag) != 0) {
                        /*
-                        * This must be the verification tag used
-                        * for sending out packets. We don't
-                        * consider packets reflecting the
-                        * verification tag.
+                        * This must be the verification tag used for
+                        * sending out packets. We don't consider packets
+                        * reflecting the verification tag.
                         */
                        if (ntohl(sh->v_tag) != stcb->asoc.peer_vtag) {
                                SCTP_TCB_UNLOCK(stcb);
@@ -317,9 +316,9 @@ sctp_ctlinput(struct icmp *icmp)
                            sizeof(struct ip) +
                            8 + (inner_ip->ip_hl << 2) + 20) {
                                /*
-                                * In this case we can check if we
-                                * got an INIT chunk and if the
-                                * initiate tag matches.
+                                * In this case we can check if we got an
+                                * INIT chunk and if the initiate tag
+                                * matches.
                                 */
                                ch = (struct sctp_init_chunk *)(sh + 1);
                                if ((ch->ch.chunk_type != SCTP_INITIATION) ||
@@ -7536,14 +7535,14 @@ sctp_peeraddr(struct socket *so, struct sockaddr **addr)
        .pr_soreceive = sctp_soreceive                          \
 
 struct protosw sctp_seqpacket_protosw = {
-       .pr_type =      SOCK_SEQPACKET,
-       .pr_flags =     PR_WANTRCVD,
+       .pr_type = SOCK_SEQPACKET,
+       .pr_flags = PR_WANTRCVD,
        SCTP_PROTOSW
 };
 
 struct protosw sctp_stream_protosw = {
-       .pr_type =      SOCK_STREAM,
-       .pr_flags =     PR_CONNREQUIRED | PR_WANTRCVD,
+       .pr_type = SOCK_STREAM,
+       .pr_flags = PR_CONNREQUIRED | PR_WANTRCVD,
        SCTP_PROTOSW
 };
 #endif
diff --git a/sys/netinet/sctp_var.h b/sys/netinet/sctp_var.h
index fc0b491bf4bb..8301ec38cf6e 100644
--- a/sys/netinet/sctp_var.h
+++ b/sys/netinet/sctp_var.h
@@ -324,8 +324,10 @@ void sctp_close(struct socket *so);
 int sctp_disconnect(struct socket *so);
 ipproto_ctlinput_t sctp_ctlinput;
 int sctp_ctloutput(struct socket *, struct sockopt *);
+#ifdef INET
 void sctp_input_with_port(struct mbuf *, int, uint16_t);
 int sctp_input(struct mbuf **, int *, int);
+#endif
 void sctp_pathmtu_adjustment(struct sctp_tcb *, uint32_t, bool);
 void
 sctp_notify(struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *,
diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c
index e6ac977e2747..4e8bfaa191eb 100644
--- a/sys/netinet6/sctp6_usrreq.c
+++ b/sys/netinet6/sctp6_usrreq.c
@@ -256,12 +256,13 @@ sctp6_ctlinput(struct ip6ctlparam *ip6cp)
        struct sctphdr sh;
        struct sockaddr_in6 src, dst;
 
-       if (icmp6_errmap(ip6cp->ip6c_icmp6) == 0)
+       if (icmp6_errmap(ip6cp->ip6c_icmp6) == 0) {
                return;
+       }
 
        /*
-        * Check if we can safely examine the ports and the
-        * verification tag of the SCTP common header.
+        * Check if we can safely examine the ports and the verification tag
+        * of the SCTP common header.
         */
        if (ip6cp->ip6c_m->m_pkthdr.len <
            (int32_t)(ip6cp->ip6c_off + offsetof(struct sctphdr, checksum))) {
@@ -301,10 +302,9 @@ sctp6_ctlinput(struct ip6ctlparam *ip6cp)
                /* Check the verification tag */
                if (ntohl(sh.v_tag) != 0) {
                        /*
-                        * This must be the verification tag used
-                        * for sending out packets. We don't
-                        * consider packets reflecting the
-                        * verification tag.
+                        * This must be the verification tag used for
+                        * sending out packets. We don't consider packets
+                        * reflecting the verification tag.
                         */
                        if (ntohl(sh.v_tag) != stcb->asoc.peer_vtag) {
                                SCTP_TCB_UNLOCK(stcb);
@@ -316,9 +316,9 @@ sctp6_ctlinput(struct ip6ctlparam *ip6cp)
                            sizeof(struct sctp_chunkhdr) +
                            offsetof(struct sctp_init, a_rwnd)) {
                                /*
-                                * In this case we can check if we
-                                * got an INIT chunk and if the
-                                * initiate tag matches.
+                                * In this case we can check if we got an
+                                * INIT chunk and if the initiate tag
+                                * matches.
                                 */
                                uint32_t initiate_tag;
                                uint8_t chunk_type;
@@ -1194,14 +1194,14 @@ sctp6_getpeeraddr(struct socket *so, struct sockaddr 
**nam)
        .pr_soreceive = sctp_soreceive
 
 struct protosw sctp6_seqpacket_protosw = {
-       .pr_type =      SOCK_SEQPACKET,
-       .pr_flags =     PR_WANTRCVD,
+       .pr_type = SOCK_SEQPACKET,
+       .pr_flags = PR_WANTRCVD,
        SCTP6_PROTOSW
 };
 
 struct protosw sctp6_stream_protosw = {
-       .pr_type =      SOCK_STREAM,
-       .pr_flags =     PR_CONNREQUIRED | PR_WANTRCVD,
+       .pr_type = SOCK_STREAM,
+       .pr_flags = PR_CONNREQUIRED | PR_WANTRCVD,
        SCTP6_PROTOSW
 };
 #endif
diff --git a/sys/netinet6/sctp6_var.h b/sys/netinet6/sctp6_var.h
index a5df12a30f26..598c086e2646 100644
--- a/sys/netinet6/sctp6_var.h
+++ b/sys/netinet6/sctp6_var.h
@@ -48,7 +48,7 @@ int sctp6_input_with_port(struct mbuf **, int *, uint16_t);
 int
 sctp6_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *,
     struct mbuf *, struct proc *);
-ip6proto_ctlinput_t    sctp6_ctlinput;
+ip6proto_ctlinput_t sctp6_ctlinput;
 void
 sctp6_notify(struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *,
     uint8_t, uint8_t, uint32_t);

Reply via email to