sysctl: don't loop when EAGAIN is returned

When userland_sysctl() experiences EAGAIN, don't loop internally but
leave retrying to the caller.
Looping was a problem in case of using tcpsso(8) to switch a TCP stack
where the acceptance check of the new TCP stack results in EAGAIN.

Reviewed by:		kib, glebius
MFC after:		1 week
MFC to:			stable/15
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D60444
This commit is contained in:
Michael Tuexen committed 2026-10-08 15:05:11 +02:00
1 parent dd51cef583
commit d39b12e903
1 file changed
+3 -8
+3 -8
View File
@@ -2580,14 +2580,9 @@ userland_sysctl(struct thread *td, int *name, u_int namelen, void *old,
}
CURVNET_SET(TD_TO_VNET(td));
for (;;) {
req.oldidx = 0;
req.newidx = 0;
error = sysctl_root(0, name, namelen, &req);
if (error != EAGAIN)
break;
kern_yield(PRI_USER);
}
req.oldidx = 0;
req.newidx = 0;
error = sysctl_root(0, name, namelen, &req);
CURVNET_RESTORE();