[chrony-dev] [PATCH] Set DSCP for IPv6.

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


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.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/