Re: [PATCH nft v2 2/2] Handle retriable errors from mnl functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 27, 2022 at 07:39:56PM +0100, Eugene Crosser wrote:
> On 27/01/2022 19:20, Pablo Neira Ayuso wrote:
> > On Thu, Dec 09, 2021 at 07:26:07PM +0100, Eugene Crosser wrote:
> >> rc == -1 and errno == EINTR mean:
> >>
> >> mnl_socket_recvfrom() - blindly rerun the function
> >> mnl_cb_run()          - restart dump request from scratch
> >>
> >> This commit introduces handling of both these conditions
> > 
> > Sorry it took me a while to come back to this.
> > 
> > https://patchwork.ozlabs.org/project/netfilter-devel/patch/20220127181835.571673-1-pablo@xxxxxxxxxxxxx/
> > 
> > This follows the same approach as src/mnl.c, no need to close the
> > reopen the socket to drop the existing messages.
> 
> Thanks for getting back to it and producing the fix!
> 
> I think it is slightly less clean, because if some (not EINTR) error happens
> while it is draining the queue (the second call to `mnl_socket_recvfrom()` with
> `eintr == true`), `errno` will be overwritten and the error misrepresented. This
> should not be a _practical_ problem because presumably the same error will be
> raised upon retry, and this time it will be reported correctly.

Good catch, sending v2.



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux