All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: <netfilter-devel@vger.kernel.org>
Cc: Florian Westphal <fw@strlen.de>
Subject: [PATCH nft v2 4/5] src: add egress support for 'list hooks'
Date: Wed, 31 Jul 2024 18:51:04 +0200	[thread overview]
Message-ID: <20240731165111.32166-5-fw@strlen.de> (raw)
In-Reply-To: <20240731165111.32166-1-fw@strlen.de>

This was missing:  Also include the egress hooks when listing
the netdev family (or unspec).

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 src/mnl.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mnl.c b/src/mnl.c
index 1b424e427124..3cacb47e7242 100644
--- a/src/mnl.c
+++ b/src/mnl.c
@@ -2529,11 +2529,12 @@ static int mnl_nft_dump_nf_arp(struct netlink_ctx *ctx, int family,
 static int mnl_nft_dump_nf_netdev(struct netlink_ctx *ctx, int family,
 				  const char *devname, struct list_head *hook_list)
 {
-	int err;
+	int err1, err2;
 
-	err = __mnl_nft_dump_nf_hooks(ctx, family, NFPROTO_NETDEV, NF_NETDEV_INGRESS, devname, hook_list);
+	err1 = __mnl_nft_dump_nf_hooks(ctx, family, NFPROTO_NETDEV, NF_NETDEV_INGRESS, devname, hook_list);
+	err2 = __mnl_nft_dump_nf_hooks(ctx, family, NFPROTO_NETDEV, NF_NETDEV_EGRESS, devname, hook_list);
 
-	return err;
+	return err1 ? err2 : err1;
 }
 
 static void release_hook_list(struct list_head *hook_list)
-- 
2.44.2


  parent reply	other threads:[~2024-07-31 17:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31 16:51 [PATCH nft v2 0/5] src: mnl: rework list hooks infra Florian Westphal
2024-07-31 16:51 ` [PATCH nft v2 1/5] src: mnl: clean up hook listing code Florian Westphal
2024-07-31 16:51 ` [PATCH nft v2 2/5] src: mnl: make family specification more strict when listing Florian Westphal
2024-07-31 16:51 ` [PATCH nft v2 3/5] src: drop obsolete hook argument form hook dump functions Florian Westphal
2024-07-31 16:51 ` Florian Westphal [this message]
2024-07-31 16:51 ` [PATCH nft v2 5/5] doc: add documentation about list hooks feature Florian Westphal
2024-08-07 16:54 ` [PATCH nft v2 0/5] src: mnl: rework list hooks infra 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=20240731165111.32166-5-fw@strlen.de \
    --to=fw@strlen.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.