netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eugene Crosser <crosser@average.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH nft] Improve handling of errors from mnl* functions"
Date: Wed,  8 Dec 2021 14:49:12 +0100	[thread overview]
Message-ID: <20211208134914.16365-1-crosser@average.org> (raw)

Libnftables does not handle errors that libmnl functions may return
properly:

1. Retriable errors indicated by errno=EINTR are not retried, but
   rather treted as fatal.
2. Instead of reporting the error to the caller, functions call
   exit() on error, which terminates the caller process.

This patch set partly addresses the second point, by calling
abort() instead of exit() on ABI error, that will at least give
more information to the sysadmin than quiet termination of a
process.

It attempts to properly address the first point, by introducing
retry logic when mnl_socket_recvfrom() or mnl_cb_run() return
-1 with errno=EINTR.

It would be desirable to fully address the second point at some
future time, though it requires some redesign of the code structure.

 [PATCH nft 1/2] Use abort() in case of netlink_abi_error
 [PATCH nft 2/2] Handle retriable errors from mnl functions


             reply	other threads:[~2021-12-08 13:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08 13:49 Eugene Crosser [this message]
2021-12-08 13:49 ` [PATCH nft 1/2] Use abort() in case of netlink_abi_error Eugene Crosser
2021-12-08 13:49 ` [PATCH nft 2/2] Handle retriable errors from mnl functions Eugene Crosser
2021-12-08 18:06   ` Pablo Neira Ayuso
2021-12-16 20:33     ` Eugene Crosser
2021-12-08 18:11   ` Pablo Neira Ayuso
  -- strict thread matches above, loose matches on Subject: below --
2021-12-08 13:51 [PATCH nft] Improve handling of errors from mnl* functions" Eugene Crosser

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=20211208134914.16365-1-crosser@average.org \
    --to=crosser@average.org \
    --cc=netfilter-devel@vger.kernel.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).