[chrony-dev] [PATCH] Set DSCP for IPv6. |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: [chrony-dev] [PATCH] Set DSCP for IPv6.
- From: Mike Ryan <msr@xxxxxxxxxx>
- Date: Tue, 15 Nov 2022 10:15:06 -0500
- Cc: Mike Ryan <msr@xxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hsilop.net; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=iU/YlRAHjJMYE6A+BFC6RrD6DdXDRlPMK2Cqri0+dXA=; b=FYe5YrFBGy/ZiOtc2epCFoX1d33o+YD8hYbJr2bQ9E4gacntOibeRmJX8wWKH1Qvbu fT5Mn3LgneWAL6nUA0R2Lly1CLCpKCqjmUojx3K6Cuj+23+tP6wxyEGVETiHlHFZHiY5 IdBAwUOXjyOYpGaHIWek9wQFv+x29LOK29GScqU2DaQ3lcVJc80MyznyJSWarpJ1HNwt f7v8gzBDfHDh7vb7zf1OH5ebTRpAvrOogsN9U/Bug3G0BLFP5BGEPz2FIQYlmN1h9A2M OWSihRmQdHOq4KVnrxLnxlm2H40Yf8IEwBhuYPMX+gFWIL3X6/PkbGz1Qs63YhoWYGvS mMPQ==
Chrony currently sets IPv4 DSCP options only. This patch adds the
necessary options for IPv6 DSCP.
---
ntp_io.c | 4 ++++
sys_linux.c | 3 +++
2 files changed, 7 insertions(+)
diff --git a/ntp_io.c b/ntp_io.c
index 86e3f26..dbe98c7 100644
--- a/ntp_io.c
+++ b/ntp_io.c
@@ -128,6 +128,10 @@ open_socket(int family, int local_port, int client_only, IPSockAddr *remote_addr
#ifdef IP_TOS
if (!SCK_SetIntOption(sock_fd, IPPROTO_IP, IP_TOS, dscp << 2))
;
+#endif
+#if defined(FEAT_IPV6) && defined(IPV6_TCLASS)
+ if (!SCK_SetIntOption(sock_fd, IPPROTO_IPV6, IPV6_TCLASS, dscp << 2))
+ ;
#endif
}
diff --git a/sys_linux.c b/sys_linux.c
index f2baab1..fde7309 100644
--- a/sys_linux.c
+++ b/sys_linux.c
@@ -634,6 +634,9 @@ SYS_Linux_EnableSystemCallFilter(int level, SYS_ProcessContext context)
#ifdef FEAT_IPV6
{ SOL_IPV6, IPV6_V6ONLY }, { SOL_IPV6, IPV6_RECVPKTINFO },
#endif
+#if defined(FEAT_IPV6) && defined(IPV6_TCLASS)
+ { SOL_IPV6, IPV6_TCLASS },
+#endif
#ifdef SO_BINDTODEVICE
{ SOL_SOCKET, SO_BINDTODEVICE },
#endif
--
2.38.1
--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble? Email listmaster@xxxxxxxxxxxxxxxxxxxx.