From nobody Fri Dec 03 21:44:10 2021 X-Original-To: dev-commits-src-main@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 964FE18B24CE; Fri, 3 Dec 2021 21:44:10 +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 4J5RDB2M5Cz3LG2; Fri, 3 Dec 2021 21:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 30EDF18717; Fri, 3 Dec 2021 21:44:10 +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 1B3LiAS1031596; Fri, 3 Dec 2021 21:44:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B3LiAOl031595; Fri, 3 Dec 2021 21:44:10 GMT (envelope-from git) Date: Fri, 3 Dec 2021 21:44:10 GMT Message-Id: <202112032144.1B3LiAOl031595@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: d79676fb1368 - main - sctp: inherit IP level socket options from listening socket List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: d79676fb1368f5acac5fd182363ea3f46fb3bd93 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638567850; 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=Oeel6r51qXH67OXKSUIC15hp/FJMiCEYc9Ppen3H3UE=; b=jkMyW/9EQ3etXsfyW9r2xfGyjxgy2T60xNpvbfWkuFxQwIIZg7tM9ISDVfIukMg6+X/6CM 95eSftjKd+ALF2cJSyPe4KUiny0PaPrM3nEXw6mXUWuD4Tjga6Z6J3jvVEDCSF5QrVWWWc XH/OAgUjqDSVJjSC2s9Jvv5o0Sce2wuznb5PssGbVFUzvc2RPe2YbiFtVO0wuKny262mt/ Xv3kosCJ6wjKlLE1ojFzpGsms+ZzRDBcyiuMsscp3JDugXXp376JXitGdnx/CYJKGUHTxK H9E4BMxBU2W6Ph4SGAKbmh69s3rk82eBe66gSZIzecWVg9ZjRMbNB79VTu3jfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638567850; a=rsa-sha256; cv=none; b=m3Zwc/uo7lfYLltUYpwFW4QtWVbGlJ3Fd20xJ3VT90F94vjDLQHfxx6lu4bpJKO8AAdp5C qDl/neOehG/rS7KpqLSNQZHouKpU/jneGCFIcDRurR3DHIU1wyYEXbnHaVNlPybtBnfN5Q bz9iT+BKF9hgmzlefbVm5FZvUklorj8eyd0Wfs6IabdYR/IP+cdtR/A7+dEjcPPJxfKujM RSOyflrUwaVA/vfWsozpIijDBWRpNX5u0F7NYS+aBNZMf9YFVrD/LdIrNYOE7w16W4OBXz yOmBqKDu/uX4K6j5lTMKbT8CUMDLN1QVUre6PJ1p1Fbf/gscS8HGV9YZPtGu+g== 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=d79676fb1368f5acac5fd182363ea3f46fb3bd93 commit d79676fb1368f5acac5fd182363ea3f46fb3bd93 Author: Michael Tuexen AuthorDate: 2021-12-03 21:40:52 +0000 Commit: Michael Tuexen CommitDate: 2021-12-03 21:44:01 +0000 sctp: inherit IP level socket options from listening socket Ensure that TTL and TOS values set on a listener get inheritet to the accepted sockets. PR: 260119 MFC after: 1 week --- sys/netinet/sctp_pcb.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 0b26ea8c1944..63a99cbc2c07 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -2622,6 +2622,15 @@ sctp_move_pcb_and_assoc(struct sctp_inpcb *old_inp, struct sctp_inpcb *new_inp, SCTP_TCB_LOCK(stcb); atomic_subtract_int(&stcb->asoc.refcnt, 1); + if (old_inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { + new_inp->ip_inp.inp.inp_flags |= old_inp->ip_inp.inp.inp_flags & INP_CONTROLOPTS; + if (old_inp->ip_inp.inp.in6p_outputopts) { + new_inp->ip_inp.inp.in6p_outputopts = ip6_copypktopts(old_inp->ip_inp.inp.in6p_outputopts, M_NOWAIT); + } + } else { + new_inp->ip_inp.inp.inp_ip_tos = old_inp->ip_inp.inp.inp_ip_tos; + new_inp->ip_inp.inp.inp_ip_ttl = old_inp->ip_inp.inp.inp_ip_ttl; + } new_inp->sctp_ep.time_of_secret_change = old_inp->sctp_ep.time_of_secret_change; memcpy(new_inp->sctp_ep.secret_key, old_inp->sctp_ep.secret_key,