Date: Wed, 29 Oct 2025 09:12:09 GMT From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 8f5162f6fc1c - stable/15 - udp: honor IPV6_TCLASS socket option for UDP/IPv4 packets Message-ID: <202510290912.59T9C9wh011165@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=8f5162f6fc1c8ac9abc55028561bb5b855fe61b8 commit 8f5162f6fc1c8ac9abc55028561bb5b855fe61b8 Author: Michael Tuexen <tuexen@FreeBSD.org> AuthorDate: 2025-10-26 17:52:33 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2025-10-29 09:08:25 +0000 udp: honor IPV6_TCLASS socket option for UDP/IPv4 packets Honor the IPPROTO_IPV6-level socket option IPV6_TCLASS when sending an UDP/IPv4 packet on an AF_INET6 socket. Reviewed by: bz, glebius Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D53346 (cherry picked from commit 3535546a86846ddb0ca5fe4a0689ac635b504459) --- sys/netinet/udp_usrreq.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 04d01099d54a..6ce1bcce6fc6 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1172,7 +1172,19 @@ udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, else INP_RLOCK(inp); NET_EPOCH_ENTER(et); +#ifdef INET6 + if ((flags & PRUS_IPV6) != 0) { + if ((inp->in6p_outputopts != NULL) && + (inp->in6p_outputopts->ip6po_tclass != -1)) + tos = (u_char)inp->in6p_outputopts->ip6po_tclass; + else + tos = 0; + } else { + tos = inp->inp_ip_tos; + } +#else tos = inp->inp_ip_tos; +#endif if (control != NULL) { /* * XXX: Currently, we assume all the optional information ishome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202510290912.59T9C9wh011165>
