ntpd: deprecate IPTOS_LOWDELAY in favor of IPTOS_DSCP_AF21

Update QoS markers.
Use DSCP AF21 for interactive traffic. DSCP is defined in RFC2474.
Many modern equipment no longer support IPTOS.

Signed-off-by: Codarren Velvindron <codarren@hackers.mu>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Codarren Velvindron 2018-04-15 20:37:50 +04:00 committed by Denys Vlasenko
parent e56e091d65
commit 7c43d43117

View File

@ -93,10 +93,10 @@
#include "libbb.h" #include "libbb.h"
#include <math.h> #include <math.h>
#include <netinet/ip.h> /* For IPTOS_LOWDELAY definition */ #include <netinet/ip.h> /* For IPTOS_DSCP_AF21 definition */
#include <sys/timex.h> #include <sys/timex.h>
#ifndef IPTOS_LOWDELAY #ifndef IPTOS_DSCP_AF21
# define IPTOS_LOWDELAY 0x10 # define IPTOS_DSCP_AF21 0x48
#endif #endif
@ -910,7 +910,7 @@ send_query_to_peer(peer_t *p)
#if ENABLE_FEATURE_IPV6 #if ENABLE_FEATURE_IPV6
if (family == AF_INET) if (family == AF_INET)
#endif #endif
setsockopt_int(fd, IPPROTO_IP, IP_TOS, IPTOS_LOWDELAY); setsockopt_int(fd, IPPROTO_IP, IP_TOS, IPTOS_DSCP_AF21);
free(local_lsa); free(local_lsa);
} }
@ -2320,7 +2320,7 @@ static NOINLINE void ntp_init(char **argv)
xfunc_die(); xfunc_die();
} }
socket_want_pktinfo(G_listen_fd); socket_want_pktinfo(G_listen_fd);
setsockopt_int(G_listen_fd, IPPROTO_IP, IP_TOS, IPTOS_LOWDELAY); setsockopt_int(G_listen_fd, IPPROTO_IP, IP_TOS, IPTOS_DSCP_AF21);
} }
#endif #endif
/* I hesitate to set -20 prio. -15 should be high enough for timekeeping */ /* I hesitate to set -20 prio. -15 should be high enough for timekeeping */