BPF Archive on lore.kernel.org
 help / Atom feed
* [PATCH] net: bpfilter: fallback to netfilter if failed to load bpfilter kernel module
@ 2019-05-15 11:40 Konstantin Khlebnikov
  2019-05-16 19:12 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Konstantin Khlebnikov @ 2019-05-15 11:40 UTC (permalink / raw)
  To: netdev, bpf, Alexei Starovoitov, linux-kernel, David S. Miller

If bpfilter is not available return ENOPROTOOPT to fallback to netfilter.

Function request_module() returns both errors and userspace exit codes.
Just ignore them. Rechecking bpfilter_ops is enough.

Fixes: d2ba09c17a06 ("net: add skeleton of bpfilter kernel module")
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
---
 net/ipv4/bpfilter/sockopt.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/bpfilter/sockopt.c b/net/ipv4/bpfilter/sockopt.c
index 15427163a041..0480918bfc7c 100644
--- a/net/ipv4/bpfilter/sockopt.c
+++ b/net/ipv4/bpfilter/sockopt.c
@@ -30,13 +30,11 @@ static int bpfilter_mbox_request(struct sock *sk, int optname,
 	mutex_lock(&bpfilter_ops.lock);
 	if (!bpfilter_ops.sockopt) {
 		mutex_unlock(&bpfilter_ops.lock);
-		err = request_module("bpfilter");
+		request_module("bpfilter");
 		mutex_lock(&bpfilter_ops.lock);
 
-		if (err)
-			goto out;
 		if (!bpfilter_ops.sockopt) {
-			err = -ECHILD;
+			err = -ENOPROTOOPT;
 			goto out;
 		}
 	}


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

* Re: [PATCH] net: bpfilter: fallback to netfilter if failed to load bpfilter kernel module
  2019-05-15 11:40 [PATCH] net: bpfilter: fallback to netfilter if failed to load bpfilter kernel module Konstantin Khlebnikov
@ 2019-05-16 19:12 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-05-16 19:12 UTC (permalink / raw)
  To: khlebnikov; +Cc: netdev, bpf, ast, linux-kernel

From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Date: Wed, 15 May 2019 14:40:52 +0300

> If bpfilter is not available return ENOPROTOOPT to fallback to netfilter.
> 
> Function request_module() returns both errors and userspace exit codes.
> Just ignore them. Rechecking bpfilter_ops is enough.
> 
> Fixes: d2ba09c17a06 ("net: add skeleton of bpfilter kernel module")
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>

Applied, thanks.

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-15 11:40 [PATCH] net: bpfilter: fallback to netfilter if failed to load bpfilter kernel module Konstantin Khlebnikov
2019-05-16 19:12 ` David Miller

BPF Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/bpf/0 bpf/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 bpf bpf/ https://lore.kernel.org/bpf \
		bpf@vger.kernel.org bpf@archiver.kernel.org
	public-inbox-index bpf


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.bpf


AGPL code for this site: git clone https://public-inbox.org/ public-inbox