Re: [chrony-dev] [PATCH] Set DSCP for IPv6. |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-dev] [PATCH] Set DSCP for IPv6.
- From: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
- Date: Wed, 16 Nov 2022 09:53:51 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668588834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=46A80e9OCsX08FJ44n4NJ0Op1rPjbsNZZfdzp/jEpGw=; b=ciNjK1GQDC8lCJz9ebS40BxK3yD7FFSh2V+9OaYy6FogrxfVX6TXZkQqMlE4LlHk7MTgXa wMp6lIRNKoO0ghj9aX8++go4sPUTx6BcWbtqYai6inzqjeKV+epas/p3RFjZhfPw7T86c5 azqX+rfAe6YAjlKk2kTB4rbXMSNT6gw=
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.