Hello, On 08/12/2021 19:06, Pablo Neira Ayuso wrote: >> --- >> src/iface.c | 73 ++++++++++++++++++++++++++++++++--------------------- >> 1 file changed, 44 insertions(+), 29 deletions(-) >> >> diff --git a/src/iface.c b/src/iface.c >> index d0e1834c..029f6476 100644 >> --- a/src/iface.c >> +++ b/src/iface.c >> @@ -66,39 +66,54 @@ void iface_cache_update(void) >> struct nlmsghdr *nlh; >> struct rtgenmsg *rt; >> uint32_t seq, portid; >> + bool need_restart; >> + int retry_count = 5; > > Did you ever hit this retry count? What is you daemon going to do > after these retries? > > Probably this can be made configurable for libraries in case you > prefer your daemon to give up after many retries, but, by default, > I'd prefer to to keep trying until you get a consistent cache from the > kernel via netlink dump. [...] > BTW, could you just rename iface_cache_update() to > __iface_cache_update() then add the loop to retry on EINTR? That would > skip this extra large indent in this patch. I have sent the new patches a week ago: [PATCH nft v2 0/2] Improve handling of errors from mnl* functions" [PATCH nft v2 1/2] Use abort() in case of netlink_abi_error [PATCH nft v2 2/2] Handle retriable errors from mnl functions Do they look better now? Thanks, Eugene
Attachment:
OpenPGP_signature
Description: OpenPGP digital signature