git: 395c8f0855e0 - main - nfs: make no-IP kernels compile
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 20 Apr 2026 11:16:34 UTC
The branch main has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=395c8f0855e0039205d9cb97adec39d9b9307c8b
commit 395c8f0855e0039205d9cb97adec39d9b9307c8b
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2026-04-18 13:27:39 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-04-20 11:15:48 +0000
nfs: make no-IP kernels compile
Compiling a LINT-NOIP kernel (assumingly also a NOINET) port and ip
are set but not used in nfsrv_getclientipaddr().
Hide the variables behind #ifdef checks and do likewise for the parsing
results. Admittingly the code probably wants to be rewritten one day.
Found with: gcc15 tinderbox build
MFC after: 3 days
Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D56502
---
sys/fs/nfsserver/nfs_nfsdstate.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c
index 845949b8f630..ccee9187bfec 100644
--- a/sys/fs/nfsserver/nfs_nfsdstate.c
+++ b/sys/fs/nfsserver/nfs_nfsdstate.c
@@ -4100,14 +4100,18 @@ nfsrv_getclientipaddr(struct nfsrv_descript *nd, struct nfsclient *clp)
#endif
u_char *addr;
int error = 0, cantparse = 0;
+#ifdef INET
union {
in_addr_t ival;
u_char cval[4];
} ip;
+#endif
+#if defined(INET6) || defined(INET)
union {
in_port_t sval;
u_char cval[2];
} port;
+#endif
/* 8 is the maximum length of the port# string. */
addr = malloc(INET6_ADDRSTRLEN + 8, M_TEMP, M_WAITOK);
@@ -4243,9 +4247,15 @@ nfsrv_getclientipaddr(struct nfsrv_descript *nd, struct nfsclient *clp)
j = nfsrv_getipnumber(cp);
if (j >= 0) {
if (i < 4)
+#ifdef INET
ip.cval[3 - i] = j;
+#else
+ ;
+#endif
+#if defined(INET6) || defined(INET)
else
port.cval[5 - i] = j;
+#endif
} else {
cantparse = 1;
break;