lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241109134011.560db783@kernel.org>
Date: Sat, 9 Nov 2024 13:40:11 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Donald Hunter <donald.hunter@...il.com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>, Eric
 Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Simon
 Horman <horms@...nel.org>, Xiao Liang <shaw.leon@...il.com>, Jiri Pirko
 <jiri@...nulli.us>, donald.hunter@...hat.com
Subject: Re: [PATCH net-next v1 2/2] tools/net/ynl: add async notification
 handling

On Fri,  8 Nov 2024 12:38:16 +0000 Donald Hunter wrote:
> +    def poll_ntf(self, interval=0.1, duration=None):
> +        endtime = time.time() + duration if duration else None

could we default duration to 0 and always check endtime?
I think we can assume that time doesn't go back for simplicity

> +        while True:
> +            try:
> +                self.check_ntf()
> +                yield self.async_msg_queue.get_nowait()
> +            except queue.Empty:
> +                try:
> +                    time.sleep(interval)

Maybe select or epoll would be better that periodic checks?

> +                except KeyboardInterrupt:
> +                    return
> +            if endtime and endtime < time.time():
> +                return

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ