git: 3a4b31e1f496 - stable/13 - Revert "netlink: allow to override sb_max for netlink sockets"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 10 Feb 2023 16:19:12 UTC
The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=3a4b31e1f49668dc4facfcfa60e6b8c8e625eff4 commit 3a4b31e1f49668dc4facfcfa60e6b8c8e625eff4 Author: Alexander V. Chernikov <melifaro@FreeBSD.org> AuthorDate: 2023-02-10 16:05:52 +0000 Commit: Alexander V. Chernikov <melifaro@FreeBSD.org> CommitDate: 2023-02-10 16:05:52 +0000 Revert "netlink: allow to override sb_max for netlink sockets" This reverts commit 4f81fdc0886f623043767866ebe4339bd12edf18. --- sys/kern/uipc_sockbuf.c | 3 +-- sys/kern/uipc_socket.c | 10 ---------- sys/sys/sockopt.h | 1 - 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index 277965412779..cbfcc0e5fe95 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -693,8 +693,7 @@ sbsetopt(struct socket *so, int cmd, u_long cc) if (*lowat > *hiwat) *lowat = *hiwat; } else { - u_long limit = sogetmaxbuf(so); - if (!sbreserve_locked_limit(sb, cc, so, limit, curthread)) + if (!sbreserve_locked(sb, cc, so, curthread)) error = ENOBUFS; } if (error == 0) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index fdf718de2483..f8931b653a4d 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -128,7 +128,6 @@ __FBSDID("$FreeBSD$"); #include <sys/event.h> #include <sys/eventhandler.h> #include <sys/poll.h> -#include <sys/priv.h> #include <sys/proc.h> #include <sys/protosw.h> #include <sys/sbuf.h> @@ -2976,15 +2975,6 @@ sooptcopyin(struct sockopt *sopt, void *buf, size_t len, size_t minlen) return (0); } -u_long -sogetmaxbuf(struct socket *so) -{ - if (so->so_proto->pr_domain->dom_family != PF_NETLINK) - return (sb_max); - u_long nl_maxsockbuf = 512 * 1024 * 1024; /* 512M, XXX: init based on physmem */ - return ((priv_check(curthread, PRIV_NET_ROUTE) == 0) ? nl_maxsockbuf : sb_max); -} - /* * Kernel version of setsockopt(2). * diff --git a/sys/sys/sockopt.h b/sys/sys/sockopt.h index d01d62f21680..cb7fc3ffca27 100644 --- a/sys/sys/sockopt.h +++ b/sys/sys/sockopt.h @@ -68,6 +68,5 @@ int accept_filt_getopt(struct socket *, struct sockopt *); int accept_filt_setopt(struct socket *, struct sockopt *); int so_setsockopt(struct socket *so, int level, int optname, void *optval, size_t optlen); -u_long sogetmaxbuf(struct socket *so); #endif /* _SYS_SOCKOPT_H_ */