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

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


On Tue, Nov 15, 2022 at 10:15:06AM -0500, Mike Ryan wrote:
> @@ -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))
> +      ;

Can you please add "family == IPADDR_INET4/6 &&" to the conditions to
avoid making an unnecessary syscall?

> 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

This could be moved inside that #ifdef FEAT_IPV6 above to change the
#if into a shorter #ifdef checking only one macro.

Thanks,

-- 
Miroslav Lichvar


-- 
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/