Skip to contentSkip to conversation

nfsdctl: allow it to handle rpcbind registration and deregistration

RFC PATCH Superseded Jeff Layton 1 participant 8 messages Sep 10

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jeff Layton

author maintainer
#0 lore raw

cover nfsdctl: allow it to handle rpcbind registration and deregistration

This patchset adds support for NFSD_A_SERVER_SOCK_USERSPACE_RPCBIND, which tells the kernel to not do rpcbind registration and to instead allow userland to handle it. After setting listeners, nfsdctl will then call out to rpcbind using the normal libtirpc client interfaces.

This is a companion set to the kernel set I recently posted (and which also should have been marked RFC).

---
Jeff Layton (7):
nfsdctl: sync nfsd_netlink.h with the kernel
nfsdctl: probe the policy of any command
nfsdctl: share the listener nest parser
nfsdctl: add rpcbind registration helpers
nfsdctl: register nfsd listeners with rpcbind
nfsdctl: clear rpcbind entries when the last thread stops
nfsdctl: add missing break in update_listeners()

 configure.ac                   |   2 +-
 support/include/nfsd_netlink.h |  18 +++
 utils/nfsdctl/Makefile.am      |  10 +-
 utils/nfsdctl/nfsdctl.8        |  16 +++
 utils/nfsdctl/nfsdctl.adoc     |  17 +++
 utils/nfsdctl/nfsdctl.c        | 194 +++++++++++++++++++++++++------
 utils/nfsdctl/rpcbind.c        | 251 +++++++++++++++++++++++++++++++++++++++++
 utils/nfsdctl/rpcbind.h        |  42 +++++++
 8 files changed, 510 insertions(+), 40 deletions(-)

---
base-commit: 630393e9c73667b3fda6a7507cb5171ec0ec38dc
change-id: 20260908-nfsdctl-rpcb-adc5a1fc090b

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>
author maintainer
#1 lore raw

RFC PATCH 1/7 nfsdctl: sync nfsd_netlink.h with the kernel

Import the attributes that let a caller own rpcbind registration:

- NFSD_A_SERVER_SOCK_USERSPACE_RPCBIND on the request
- NFSD_A_SERVER_SOCK_RPCBIND, and the NFSD_A_RPCBIND_* nest, on the reply

The file comes from include/uapi/linux/nfsd_netlink.h. No code reads the new attributes yet.

Bump the USE_SYSTEM_NFSD_NETLINK_H probe to one of the new attributes. It tested NFSD_CMD_SERVER_STATS_GET, which has been in the uapi header since v6.9, so any host with headers that new picks the system copy and loses everything imported here.

---
 configure.ac                   |  2 +-
 support/include/nfsd_netlink.h | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)
configure.ac +1 -1
index 2ce1e129e5d4..d9d268975d7d 100644
@@ -259,7 +259,7 @@ AC_CHECK_HEADERS(linux/nfsd_netlink.h)
 
 # ensure the system netlink headers have the latest features
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <linux/nfsd_netlink.h>]],
-			                   [[int foo = NFSD_CMD_SERVER_STATS_GET;]])],
+			                   [[int foo = NFSD_A_SERVER_SOCK_USERSPACE_RPCBIND;]])],
 			   [AC_DEFINE([USE_SYSTEM_NFSD_NETLINK_H], 1,
 				      ["Use system's linux/nfsd_netlink.h"])])
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <linux/lockd_netlink.h>]],
support/include/nfsd_netlink.h +18 -0
index 87da1d0bb21e..400322857d16 100644
@@ -50,6 +50,13 @@ enum nfsd_xprtsec_mode {
 	NFSD_XPRTSEC_MODE_MTLS = 4,
 };
 
+/*
+ * Constraints that apply to an rpcbind registration.
+ */
+enum nfsd_rpcbind_flags {
+	NFSD_RPCBIND_FLAGS_NO_UDP = 1,
+};
+
 enum {
 	NFSD_A_CACHE_NOTIFY_CACHE_TYPE = 1,
 
@@ -113,8 +120,19 @@ enum {
 	NFSD_A_SOCK_MAX = (__NFSD_A_SOCK_MAX - 1)
 };
 
+enum {
+	NFSD_A_RPCBIND_PROGRAM = 1,
+	NFSD_A_RPCBIND_VERSION,
+	NFSD_A_RPCBIND_FLAGS,
+
+	__NFSD_A_RPCBIND_MAX,
+	NFSD_A_RPCBIND_MAX = (__NFSD_A_RPCBIND_MAX - 1)
+};
+
 enum {
 	NFSD_A_SERVER_SOCK_ADDR = 1,
+	NFSD_A_SERVER_SOCK_USERSPACE_RPCBIND,
+	NFSD_A_SERVER_SOCK_RPCBIND,
 
 	__NFSD_A_SERVER_SOCK_MAX,
 	NFSD_A_SERVER_SOCK_MAX = (__NFSD_A_SERVER_SOCK_MAX - 1)
Signature · 1 line
2.55.0
author maintainer
#2 lore raw

RFC PATCH 2/7 nfsdctl: probe the policy of any command

In reply to Jeff Layton

query_nfsd_nl_policy() asks CTRL_CMD_GETPOLICY about NFSD_CMD_THREADS_SET only. getpolicy_handler() writes the highest attribute straight into a global. A second command cannot use either function.

query_nfsd_nl_cmd_policy() now takes the command number. getpolicy_handler() now writes through its callback argument. query_nfsd_nl_policy() keeps its name and still probes THREADS_SET.

No functional change.

---
 utils/nfsdctl/nfsdctl.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
utils/nfsdctl/nfsdctl.c +13 -5
index c7126748dac9..8733f0377208 100644
@@ -500,6 +500,7 @@ static int nfsd_nl_family_setup(struct nl_sock *sock)
 static int getpolicy_handler(struct nl_msg *msg, void *arg)
 {
 	struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
+	int *max_nlattr = arg;
 	struct nlattr *attr;
 	int rem;
 
@@ -512,8 +513,8 @@ static int getpolicy_handler(struct nl_msg *msg, void *arg)
 				nla_for_each_nested(b, a, j) {
 					int idx = nla_type(b);
 
-					if (nfsd_threads_max_nlattr < idx)
-						nfsd_threads_max_nlattr = idx;
+					if (*max_nlattr < idx)
+						*max_nlattr = idx;
 				}
 			}
 		}
@@ -521,7 +522,8 @@ static int getpolicy_handler(struct nl_msg *msg, void *arg)
 	return NL_SKIP;
 }
 
-static int query_nfsd_nl_policy(struct nl_sock *sock)
+static int query_nfsd_nl_cmd_policy(struct nl_sock *sock, int cmd,
+				    int *max_nlattr)
 {
 	struct genlmsghdr *ghdr;
 	struct nlmsghdr *nlh;
@@ -549,7 +551,7 @@ static int query_nfsd_nl_policy(struct nl_sock *sock)
 	}
 
 	nla_put_u16(msg, CTRL_ATTR_FAMILY_ID, nfsd_nl_family);
-	nla_put_u32(msg, CTRL_ATTR_OP, NFSD_CMD_THREADS_SET);
+	nla_put_u32(msg, CTRL_ATTR_OP, cmd);
 
 	ret = nl_send_auto(sock, msg);
 	if (ret < 0)
@@ -559,7 +561,7 @@ static int query_nfsd_nl_policy(struct nl_sock *sock)
 	nl_cb_err(cb, NL_CB_CUSTOM, error_handler, &ret);
 	nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, finish_handler, &ret);
 	nl_cb_set(cb, NL_CB_ACK, NL_CB_CUSTOM, ack_handler, &ret);
-	nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, getpolicy_handler, NULL);
+	nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, getpolicy_handler, max_nlattr);
 
 	while (ret > 0)
 		nl_recvmsgs(sock, cb);
@@ -574,6 +576,12 @@ out:
 	return ret;
 }
 
+static int query_nfsd_nl_policy(struct nl_sock *sock)
+{
+	return query_nfsd_nl_cmd_policy(sock, NFSD_CMD_THREADS_SET,
+					&nfsd_threads_max_nlattr);
+}
+
 static void status_usage(void)
 {
 	printf("Usage: %s status\n", taskname);
Signature · 1 line
2.55.0
author maintainer
#3 lore raw

RFC PATCH 3/7 nfsdctl: share the listener nest parser

In reply to Jeff Layton

parse_listener_get() unpacks a NFSD_A_SERVER_SOCK_ADDR nest inline. It also treats every top-level attribute as one of those nests. A LISTENER_GET reply carries nothing else, so the loop is correct today. A reply that mixes attributes would count the other attributes as listeners.

Move the nest walk into parse_sock_nest(). Skip an attribute that is not a listener. Stop at MAX_NFSD_SOCKETS.

No functional change.

---
 utils/nfsdctl/nfsdctl.c | 45 +++++++++++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 18 deletions(-)
utils/nfsdctl/nfsdctl.c +27 -18
index 8733f0377208..dd815ac53489 100644
@@ -273,6 +273,28 @@ static void parse_version_get(struct genlmsghdr *gnlh)
 	}
 }
 
+/* Unpack one NFSD_A_SERVER_SOCK_ADDR nest. */
+static void parse_sock_nest(struct nlattr *attr, struct server_socket *sock)
+{
+	struct nlattr *a;
+	char *res;
+	int i;
+
+	nla_for_each_nested(a, attr, i) {
+		switch (nla_type(a)) {
+		case NFSD_A_SOCK_TRANSPORT_NAME:
+			res = strncpy(sock->name, nla_data(a),
+				      MAX_CLASS_NAME_LEN);
+			res[MAX_CLASS_NAME_LEN - 1] = '\0'; // just to be sure
+			break;
+		case NFSD_A_SOCK_ADDR:
+			memcpy(&sock->ss, nla_data(a), sizeof(sock->ss));
+			break;
+		}
+		sock->active = true;
+	}
+}
+
 static void parse_listener_get(struct genlmsghdr *gnlh)
 {
 	struct nlattr *attr;
@@ -283,24 +305,11 @@ static void parse_listener_get(struct genlmsghdr *gnlh)
 
 	nla_for_each_attr(attr, genlmsg_attrdata(gnlh, 0),
 			  genlmsg_attrlen(gnlh, 0), rem) {
-		struct nlattr *a;
-		char *res;
-		int i;
-
-		nla_for_each_nested(a, attr, i) {
-			switch (nla_type(a)) {
-			case NFSD_A_SOCK_TRANSPORT_NAME:
-				res = strncpy(nfsd_sockets[idx].name, nla_data(a),
-					      MAX_CLASS_NAME_LEN);
-				res[MAX_CLASS_NAME_LEN - 1] = '\0'; // just to be sure
-				break;
-			case NFSD_A_SOCK_ADDR:
-				memcpy(&nfsd_sockets[idx].ss, nla_data(a),
-					sizeof(nfsd_sockets[idx].ss));
-				break;
-			}
-			nfsd_sockets[idx].active = true;
-		}
+		if (nla_type(attr) != NFSD_A_SERVER_SOCK_ADDR)
+			continue;
+		if (idx >= MAX_NFSD_SOCKETS)
+			break;
+		parse_sock_nest(attr, &nfsd_sockets[idx]);
 		++idx;
 	}
 	nfsd_socket_count = idx;
Signature · 1 line
2.55.0
author maintainer
#4 lore raw

RFC PATCH 4/7 nfsdctl: add rpcbind registration helpers

In reply to Jeff Layton

Add the code that calls the local rpcbind. The callers come next.

nfsd_rpcb_register() matches each listener against each program that the kernel reported. It calls rpcb_set() for every pair.

nfsd_rpcb_unset_all() clears every nfsd entry with nfs_svc_unregister(). That helper calls rpcb_unset() with no netconfig, so one call covers every netid.

Three rules match what the kernel did:

- nfsdctl registers the wildcard address with the listener's port. It does not register the address that the listener uses. __svc_rpcb_register4() and __svc_rpcb_register6() did the same.
- nfsdctl does not register an RDMA listener. svc_register() runs only from svc_setup_socket(), so an RDMA listener never reached rpcbind.
- nfsdctl does not register a program that carries the no-udp flag on udp or udp6. NFSv4 sets vs_need_cong_ctrl, so the kernel never advertised NFSv4 there.

A failed call writes a warning and does not stop the caller. NFSv4 does not need rpcbind. A v2 or v3 client that already knows the port does not need it either.

rpcb_set() and the netconfig database are TI-RPC only, so the registration side sits under HAVE_LIBTIRPC with a warning stub, matching getport.c and rpc_socket.c. nfsd_rpcb_unset_all() needs neither and stays unconditional; nfs_svc_unregister() has a pmap_unset() variant.

struct server_socket moves to the new header, because both files read it. The netlink spec generates nfsdctl.h, so the definition cannot live there.

---
 utils/nfsdctl/Makefile.am |  10 +-
 utils/nfsdctl/nfsdctl.c   |  13 +--
 utils/nfsdctl/rpcbind.c   | 251 ++++++++++++++++++++++++++++++++++++++++++++++
 utils/nfsdctl/rpcbind.h   |  42 ++++++++
 4 files changed, 300 insertions(+), 16 deletions(-)
utils/nfsdctl/Makefile.am +6 -4
index 89c7ecd6f30b..1390c43c855d 100644
@@ -5,9 +5,11 @@ EXTRA_DIST      = $(man8_MANS)
 
 sbin_PROGRAMS	= nfsdctl
 
-noinst_HEADERS = nfsdctl.h
-nfsdctl_SOURCES = nfsdctl.c
-nfsdctl_CFLAGS = $(LIBNL3_CFLAGS) $(LIBNLGENL3_CFLAGS) $(LIBREADLINE_CFLAGS)
-nfsdctl_LDADD = ../../support/nfs/libnfs.la $(LIBNL3_LIBS) $(LIBNLGENL3_LIBS) $(LIBREADLINE_LIBS)
+noinst_HEADERS = nfsdctl.h rpcbind.h
+nfsdctl_SOURCES = nfsdctl.c rpcbind.c
+nfsdctl_CFLAGS = $(LIBNL3_CFLAGS) $(LIBNLGENL3_CFLAGS) $(LIBREADLINE_CFLAGS) \
+		 $(TIRPC_CFLAGS)
+nfsdctl_LDADD = ../../support/nfs/libnfs.la $(LIBNL3_LIBS) $(LIBNLGENL3_LIBS) \
+		$(LIBREADLINE_LIBS) $(LIBTIRPC)
 
 MAINTAINERCLEANFILES = Makefile.in
utils/nfsdctl/nfsdctl.c +1 -12
index dd815ac53489..860ea9c09ad2 100644
@@ -46,6 +46,7 @@
 
 #include "nfslib.h"
 #include "nfsdctl.h"
+#include "rpcbind.h"
 #include "conffile.h"
 #include "xlog.h"
 
@@ -72,18 +73,6 @@ struct nfs_version {
 
 struct nfs_version nfsd_versions[MAX_NFS_VERSIONS];
 
-/*
- * All of the existing netids are short strings (3-4 chars), but let's allow
- * for up to 16.
- */
-#define MAX_CLASS_NAME_LEN	16
-
-struct server_socket {
-	struct sockaddr_storage	ss;
-	char name[MAX_CLASS_NAME_LEN];
-	bool active;
-};
-
 #define MAX_NFSD_SOCKETS		256
 
 int nfsd_socket_count;
utils/nfsdctl/rpcbind.c new file +251 -0

251 lines not on this page · raw message

utils/nfsdctl/rpcbind.h new file +42 -0

42 lines not on this page · raw message

Signature · 1 line
2.55.0
author maintainer
#5 lore raw

RFC PATCH 5/7 nfsdctl: register nfsd listeners with rpcbind

In reply to Jeff Layton

The kernel registered NFS and NFSACL under nfsd_mutex. Every call was synchronous. A local rpcbind that never replied therefore blocked every other NFSD netlink command, and tripped the hung-task watchdog.

A kernel that offers NFSD_A_SERVER_SOCK_USERSPACE_RPCBIND makes no rpcbind call of its own. It answers a listener_set that carries the flag with the programs to register and the listeners that started. This program now does three steps instead:

1: send the flag
2: read the reply
3: register the listeners, where nothing holds a lock

Read the maximum attribute of LISTENER_SET to detect support. This adds no configuration. An older kernel does not offer the attribute, so that kernel keeps the registration. A build without TI-RPC has no rpcb_set(), so it reports no support either and leaves the kernel in charge.

nfsdctl clears every nfsd entry before it registers. rpcbind matches an unset on [program, version, netid] and takes no address, so an unset cannot drop one of two TCP ports. The sweep also replaces the svc_unregister() that svc_rpcb_setup() ran at serv creation. An sv_no_rpcbind serv no longer reaches that call.

The reply names only the listeners that started. A request that failed part way therefore registers what exists, not what the caller asked for.

---
 utils/nfsdctl/nfsdctl.8    |  16 +++++++
 utils/nfsdctl/nfsdctl.adoc |  17 ++++++++
 utils/nfsdctl/nfsdctl.c    | 104 ++++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 135 insertions(+), 2 deletions(-)
utils/nfsdctl/nfsdctl.8 +16 -0
index 1f526e77bebf..d90f1eb96a41 100644
@@ -337,6 +337,22 @@ interface to achieve the same goals.
 Most of the commands that query the NFS server can be run as an unprivileged
 user, but configuring the server typically requires an account with elevated
 privileges.
+.SS "rpcbind registration"
+.sp
+On a kernel that supports it, nfsdctl registers the NFS and NFSACL programs
+with the local rpcbind itself. The kernel made those calls while it held an
+internal mutex, where a slow rpcbind blocked every other NFSD netlink
+command. nfsdctl detects support and needs no configuration.
+.sp
+nfsdctl registers the listeners after it sets them, and it clears the
+entries when the last thread stops. A failed registration is not fatal. The
+server starts, but a client that looks the server up in rpcbind cannot find
+it. NFSv4 does not need rpcbind, and a v2 or v3 client that already knows
+the port does not need it either.
+.sp
+RDMA listeners are not registered, which matches what the kernel did.
+.sp
+lockd still registers NLM itself on every kernel.
 .SH "SEE ALSO"
 .sp
 nfs.conf(5), rpc.nfsd(8), rpc.mountd(8), exports(5), exportfs(8), rpc.rquotad(8), nfsstat(8), netconfig(5)
utils/nfsdctl/nfsdctl.adoc +17 -0
index e85348e29ed8..bd21234b0d9d 100644
@@ -176,6 +176,23 @@ Most of the commands that query the NFS server can be run as an unprivileged
 user, but configuring the server typically requires an account with elevated
 privileges.
 
+=== rpcbind registration
+
+On a kernel that supports it, nfsdctl registers the NFS and NFSACL programs
+with the local rpcbind itself. The kernel made those calls while it held an
+internal mutex, where a slow rpcbind blocked every other NFSD netlink
+command. nfsdctl detects support and needs no configuration.
+
+nfsdctl registers the listeners after it sets them, and it clears the
+entries when the last thread stops. A failed registration is not fatal. The
+server starts, but a client that looks the server up in rpcbind cannot find
+it. NFSv4 does not need rpcbind, and a v2 or v3 client that already knows
+the port does not need it either.
+
+RDMA listeners are not registered, which matches what the kernel did.
+
+lockd still registers NLM itself on every kernel.
+
 == SEE ALSO
 
 nfs.conf(5), rpc.nfsd(8), rpc.mountd(8), exports(5), exportfs(8), rpc.rquotad(8), nfsstat(8), netconfig(5)
utils/nfsdctl/nfsdctl.c +102 -2

152 lines not on this page · raw message

Signature · 1 line
2.55.0
author maintainer
#6 lore raw

RFC PATCH 6/7 nfsdctl: clear rpcbind entries when the last thread stops

In reply to Jeff Layton

nfsd destroys the serv when the last thread stops. The kernel used to clear the rpcbind entries on that path, through svc_rpcb_cleanup(). A serv that let this program own rpcbind does not clear them. The entries would then outlive the server and name a port that nothing listens on.

Clear them from "nfsdctl threads 0". nfs-server.service runs that command to stop the server.

zero_threads was true when any one pool argument was zero. That is the wrong test to hang the sweep off: "nfsdctl threads 8 0" empties pool 1, keeps the serv, and would have cleared every entry under a running server. Sum the pool counts instead.

---
 utils/nfsdctl/nfsdctl.c | 26 +++++++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)
utils/nfsdctl/nfsdctl.c +21 -5
index 370784e8fe8c..a96faee6cbea 100644
@@ -832,7 +832,7 @@ static int threads_func(struct nl_sock *sock, int argc, char **argv)
 	uint8_t cmd = NFSD_CMD_THREADS_GET;
 	int *pool_threads = NULL;
 	int minthreads = -1;
-	int opt, pools = 0;
+	int opt, pools = 0, ret;
 	uuid_t fh_key;
 	bool zero_threads = false;
 
@@ -873,7 +873,7 @@ static int threads_func(struct nl_sock *sock, int argc, char **argv)
 
 	if (optind < argc) {
 		char **targv = &argv[optind];
-		int i;
+		int i, total = 0;
 
 		pools = argc - optind;
 		pool_threads = alloca(pools * sizeof(*pool_threads));
@@ -889,13 +889,18 @@ static int threads_func(struct nl_sock *sock, int argc, char **argv)
 			}
 
 			pool_threads[i] = strtol(targv[i], &endptr, 0);
-			if (!pool_threads[i])
-				zero_threads = true;
+			total += pool_threads[i];
 			if (!endptr || *endptr != '\0') {
 				xlog(L_ERROR, "Invalid threads value %s.", argv[1]);
 				return 1;
 			}
 		}
+
+		/*
+		 * The serv only goes away when no pool has a thread left.
+		 * "threads 8 0" empties one pool and keeps the server up.
+		 */
+		zero_threads = (total == 0);
 	}
 	/* check if there are active listeners added */
 	if (fetch_current_listeners(sock)) {
@@ -908,14 +913,25 @@ static int threads_func(struct nl_sock *sock, int argc, char **argv)
 			 * listener. If we ever add functionality to remove
 			 * listeners on an active server, we need to revisit this.
 			 */
+			if (userspace_rpcbind_supported())
+				nfsd_rpcb_unset_all();
 			return 0;
 		}
 		xlog(L_ERROR, "No active listeners added, not starting threads");
 		return 1;
 	}
 
-	return threads_doit(sock, cmd, 0, 0, pools, pool_threads, NULL,
+	ret = threads_doit(sock, cmd, 0, 0, pools, pool_threads, NULL,
 				minthreads, fh_key);
+
+	/*
+	 * The last thread destroys the serv, and a serv that never called
+	 * rpcb_create_local() leaves its entries behind.
+	 */
+	if (!ret && zero_threads && userspace_rpcbind_supported())
+		nfsd_rpcb_unset_all();
+
+	return ret;
 }
 
 /*
Signature · 1 line
2.55.0
author maintainer
#7 lore raw

RFC PATCH 7/7 nfsdctl: add missing break in update_listeners()

In reply to Jeff Layton

The AF_INET arm fell through into AF_INET6, so a v4 listener that matched on port and address was then re-tested as a sockaddr_in6 and skipped. -Wimplicit-fallthrough is not enabled, so nothing caught it.

Terminate every arm. The AF_INET6 fallthrough was harmless, since "default:" is empty, but it is a trap for the next case added.

---
 utils/nfsdctl/nfsdctl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
utils/nfsdctl/nfsdctl.c +3 -1
index a96faee6cbea..7c639b56c8a1 100644
@@ -1406,13 +1406,15 @@ static int update_listeners(const char *str)
 				if (r4->sin_port != l4->sin_port ||
 				    memcmp(&r4->sin_addr, &l4->sin_addr, sizeof(l4->sin_addr)))
 					continue;
+				break;
 			case AF_INET6:
 				if (r6->sin6_port != l6->sin6_port ||
 				    memcmp(&r6->sin6_addr, &l6->sin6_addr, sizeof(l6->sin6_addr)) ||
 				    !ipv6_is_enabled())
 					continue;
+				break;
 			default:
-
+				break;
 			}
 			sock->active = (sign == '+');
 			found = true;
Signature · 1 line
2.55.0