netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eugene Crosser <crosser@average.org>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft v2 2/2] Handle retriable errors from mnl functions
Date: Thu, 27 Jan 2022 19:39:56 +0100	[thread overview]
Message-ID: <33c871d0-ec0e-2039-3a83-837c76d64fbe@average.org> (raw)
In-Reply-To: <YfLiitlOadGmfK7v@salvia>


[-- Attachment #1.1: Type: text/plain, Size: 1098 bytes --]

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@netfilter.org/
> 
> 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.

Thanks again,

Eugene

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-01-27 18:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 18:26 [PATCH nft v2 0/2] Improve handling of errors from mnl* functions" Eugene Crosser
2021-12-09 18:26 ` [PATCH nft v2 1/2] Use abort() in case of netlink_abi_error Eugene Crosser
2022-01-26  1:11   ` Pablo Neira Ayuso
2021-12-09 18:26 ` [PATCH nft v2 2/2] Handle retriable errors from mnl functions Eugene Crosser
2022-01-27 18:20   ` Pablo Neira Ayuso
2022-01-27 18:39     ` Eugene Crosser [this message]
2022-01-27 23:04       ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=33c871d0-ec0e-2039-3a83-837c76d64fbe@average.org \
    --to=crosser@average.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).