netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft] Improve handling of errors from mnl* functions"
@ 2021-12-08 13:49 Eugene Crosser
  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
  0 siblings, 2 replies; 7+ messages in thread
From: Eugene Crosser @ 2021-12-08 13:49 UTC (permalink / raw)
  To: netfilter-devel

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


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH nft] Improve handling of errors from mnl* functions"
@ 2021-12-08 13:51 Eugene Crosser
  0 siblings, 0 replies; 7+ messages in thread
From: Eugene Crosser @ 2021-12-08 13:51 UTC (permalink / raw)
  To: netfilter-devel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-16 20:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-08 13:49 [PATCH nft] Improve handling of errors from mnl* functions" Eugene Crosser
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

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).