Re: [PATCH net-next v3 2/2] tools: ynl: add unicast notification receive support
From: Jakub Kicinski
Date: Tue May 19 2026 - 18:45:47 EST
On Tue, 19 May 2026 18:31:53 +0800 Minxi Hou wrote:
> ynl.ntf_subscribe(mcast_name) -- join a multicast group
> + ynl.ntf_listen() -- bind socket for unicast notifications
> ynl.check_ntf() -- drain pending notifications
> ynl.poll_ntf(duration=None) -- yield notifications
>
> @@ -748,6 +749,10 @@ class YnlFamily(SpecFamily):
> self.sock.setsockopt(Netlink.SOL_NETLINK, Netlink.NETLINK_ADD_MEMBERSHIP,
> mcast_id)
>
> + def ntf_listen(self):
> + """Bind socket for receiving unicast notifications."""
> + self.sock.bind((0, 0))
_listen() seems like a pretty bad name, given that listen()
is also a system call name, and we're doing a bind().
If we want a method to do this (as opposed to the user calling
ynl.sock.bind() themselves) we should probably call the method
bind() and pass the address tuple as an arg (default to (0, 0)).
--
pw-bot: cr