Skip to contentSkip to conversation

net: bpfilter: fallback to netfilter if failed to load bpfilter kernel module

PATCH Applied Konstantin Khlebnikov 2 participants 2 messages May 15, 2019 – May 16, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: bpfilter: fallback to netfilter if failed to load bpfilter kernel module

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")
---
 net/ipv4/bpfilter/sockopt.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
net/ipv4/bpfilter/sockopt.c +2 -4
index 15427163a041..0480918bfc7c 100644
@@ -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;
 		}
 	}
maintainer Applied
#1 lore raw

From: Konstantin Khlebnikov <[email protected]>
Date: Wed, 15 May 2019 14:40:52 +0300

Quoted 7 lines

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

Applied, thanks.