From nobody Sun Nov 06 23:07:46 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4N594f6drrz4hQ1K; Sun, 6 Nov 2022 23:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N594f6313z3rp8; Sun, 6 Nov 2022 23:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667776066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QSLcz+hEYmDrv0hieMuAo8OF+6LL5tBAGdrMUjAWx2Y=; b=l5HgmJ96xmlUwWf9NKDNvxj7yVPWE1x/eY1PsNmyHLV9P6E5BkU6gEDGhZnwjO+AC/n9Sd MtlXqT9yIYpR4cKY/rXiDcdVIpVXT2Gz7fYJTn7OHN2bCyctDQC030mrYFGpOtC7U3bgqz /HXzrnA8fR7dlpupMPXxoWs/kAneWGAlnj3jJ24qr5vsdYqgvQpCMYLYfKUgfuRxRIhuU+ xX5t26bvLGlF873HeYkzYjHrAHu/PlSdBRzIHZIuHgp1KhIJrWLzEBSzreV6EvNi8jegwR GettxgOwoy7jL5+WefeTCTwMIQQ0dbFPeIMzmfny1ZgZJ2MQ8wtHllFNgGetNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4N594f53gRzdpv; Sun, 6 Nov 2022 23:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2A6N7kvE021013; Sun, 6 Nov 2022 23:07:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A6N7k74021012; Sun, 6 Nov 2022 23:07:46 GMT (envelope-from git) Date: Sun, 6 Nov 2022 23:07:46 GMT Message-Id: <202211062307.2A6N7k74021012@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: f83db6441a2f - main - sctp: minor changes due to upstreaming of Glebs recent changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f83db6441a2f4f925a169c7ddf844589cb73c9b5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667776066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QSLcz+hEYmDrv0hieMuAo8OF+6LL5tBAGdrMUjAWx2Y=; b=p4k7Da60CfSSgI7eGYBeqXagiTFa70VnCT78S4AlVUdhwQZQKO4nm+mY5YDVL/NwZkT9Vm g3K+a/FvdG/73fW4OqePkIJR2hpBuC++Rn9tvQi2bPBPYo67IBPlksTy4qx33aK0KJesKv HrKadkIYyzlfp9LspwBG6yBs4QaUhtkf7gaRcaDo1enl4Ap8Ernuj4cvpPvv0v8PH7LLEE DHaJ+pFVTqTV3Nq+mB9JQH0pvINbUKy7AxUHFetpecMMZG8NtOL2eUOYo9gkSQtQrsP2tL G0emx19Eohy58e8T2Kezdml9+1Mz0cEHv4J27lXKMyHamHtdDvJ+OLsEpNM+wg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667776066; a=rsa-sha256; cv=none; b=uu/LoAOyUrIGqsHAY8idlQyN9xWnispNV4S2ewnfO0jzU+O4tEn0S6uMoSM9ovEMCwoAz4 +TERXXGh/ogFtn0QhHei0ACU97UCV8DyftmeP9+O/3sUkJAGAhcv/p8XRcUwyUDxzRPrNy U4YuRBs15zgik9gW4EHXh42pvmNvJad9CTtwnU1NtBLP7yhLtXIvCr/fsy/e8K+IU2mPO4 yhu+ikJj4zNQNT+C+XS6byslWzndUeRqzXgFK1tZP0I7KQ7JzOinylak0jqlc0FvlDBV+Y Y8f+u1pGaZG7Hrnq/4W8sfBcZXX3VeX2wczyFRA3h53bcPJIBmPhRRtDZ8MRnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f83db6441a2f4f925a169c7ddf844589cb73c9b5 commit f83db6441a2f4f925a169c7ddf844589cb73c9b5 Author: Michael Tuexen AuthorDate: 2022-11-06 22:06:40 +0000 Commit: Michael Tuexen 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);