Date: Mon, 9 Jun 2025 13:28:30 -0700 From: Rick Macklem <rick.macklem@gmail.com> To: Konstantin Belousov <kostikbel@gmail.com> Cc: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= <des@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 79d0f4474653 - main - rpcbind: Ensure krpc is present. Message-ID: <CAM5tNy6-xtDYQPw6vr588e2r=tX76pWZnKPczwaCrZ5j5XnCEw@mail.gmail.com> In-Reply-To: <aEbPE5oG47SuN2y0@kib.kiev.ua> References: <202506091053.559ArJ8k043104@gitrepo.freebsd.org> <aEbKLniIuHd4xuq7@kib.kiev.ua> <CAM5tNy7uGWg4gOsy%2BM7_vneObuszzxNhGAJF-6rd%2Byjqc00QeA@mail.gmail.com> <aEbPE5oG47SuN2y0@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jun 9, 2025 at 5:10=E2=80=AFAM Konstantin Belousov <kostikbel@gmail= .com> wrote: > > CAUTION: This email originated from outside of the University of Guelph. = Do not click links or open attachments unless you recognize the sender and = know the content is safe. If in doubt, forward suspicious emails to IThelp@= uoguelph.ca. > > On Mon, Jun 09, 2025 at 04:59:15AM -0700, Rick Macklem wrote: > > On Mon, Jun 9, 2025 at 4:49=E2=80=AFAM Konstantin Belousov <kostikbel@g= mail.com> wrote: > > > > > > CAUTION: This email originated from outside of the University of Guel= ph. Do not click links or open attachments unless you recognize the sender = and know the content is safe. If in doubt, forward suspicious emails to ITh= elp@uoguelph.ca. > > > > > > On Mon, Jun 09, 2025 at 10:53:19AM +0000, Dag-Erling Sm=C3=B8rgrav wr= ote: > > > > The branch main has been updated by des: > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D79d0f447465394fee8af= a833dbdeb1a5f3ed52c3 > > > > > > > > commit 79d0f447465394fee8afa833dbdeb1a5f3ed52c3 > > > > Author: Dag-Erling Sm=C3=B8rgrav <des@FreeBSD.org> > > > > AuthorDate: 2025-06-09 10:52:21 +0000 > > > > Commit: Dag-Erling Sm=C3=B8rgrav <des@FreeBSD.org> > > > > CommitDate: 2025-06-09 10:52:21 +0000 > > > > > > > > rpcbind: Ensure krpc is present. > > > > > > > > MFC after: 1 week > > > > Reviewed by: rmacklem, glebius > > > > Differential Revision: https://reviews.freebsd.org/D50627 > > > > --- > > > > usr.sbin/rpcbind/rpcbind.c | 35 +++++++++++++++++++++-------------= - > > > > 1 file changed, 21 insertions(+), 14 deletions(-) > > > > > > > > diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.= c > > > > index 1397a0222396..622e954f903b 100644 > > > > --- a/usr.sbin/rpcbind/rpcbind.c > > > > +++ b/usr.sbin/rpcbind/rpcbind.c > > > > @@ -39,34 +39,38 @@ > > > > * > > > > */ > > > > > > > > -#include <sys/types.h> > > > > -#include <sys/stat.h> > > > > -#include <sys/errno.h> > > > > -#include <sys/time.h> > > > > +#include <sys/param.h> > > > > +#include <sys/linker.h> > > > > +#include <sys/module.h> > > > > #include <sys/resource.h> > > > > -#include <sys/wait.h> > > > > #include <sys/signal.h> > > > > #include <sys/socket.h> > > > > +#include <sys/stat.h> > > > > +#include <sys/time.h> > > > > #include <sys/un.h> > > > > +#include <sys/wait.h> > > > > + > > > > #include <rpc/rpc.h> > > > > #include <rpc/rpc_com.h> > > > > #ifdef PORTMAP > > > > #include <netinet/in.h> > > > > #endif > > > > #include <arpa/inet.h> > > > > + > > > > #include <assert.h> > > > > +#include <err.h> > > > > +#include <errno.h> > > > > #include <fcntl.h> > > > > +#include <netconfig.h> > > > > #include <netdb.h> > > > > +#include <pwd.h> > > > > #include <stdbool.h> > > > > #include <stdio.h> > > > > -#include <netconfig.h> > > > > #include <stdlib.h> > > > > -#include <unistd.h> > > > > -#include <syslog.h> > > > > -#include <err.h> > > > > -#include <pwd.h> > > > > #include <string.h> > > > > -#include <errno.h> > > > > +#include <syslog.h> > > > > +#include <unistd.h> > > > > + > > > > #include "rpcbind.h" > > > > > > > > /* Global variables */ > > > > @@ -148,12 +152,15 @@ main(int argc, char *argv[]) > > > > > > > > update_bound_sa(); > > > > > > > > + /* Ensure krpc is loaded */ > > > > + if (modfind("krpc") < 0 && kldload("krpc") < 0) > > > > + err(1, "krpc"); > > > Why does rpcbind need krpc mod? > > > I understand that today most uses of Sun RPC are coming from nfs stuf= f. > > > But it is still not the only application. E.g., NIS is still there. > > > > I asked the same thig during review. It appears that the requirement > > is based on the recent change to using RPC over netlink instead > > of a unix domain socket, done by glebius@. > > For what? > Take for instance a machine participating in NIS domain but not doing NFS= . My vague recollection (I'll admit I cannot be bothered looking at the older code) is that rpcbind would accept queries on a AF_LOCAL (unix domain) socket for local RPC processes. glebius@ does not want RPCs to be done over AF_LOCAL sockets (he would have to explain why), so he created an RPC layer in the krpc for netlink as= an alternative and converted all utilities that were doing RPCs over AF_LOCAL sockets to use it. --> Since some part of the netlink conversion is in the krpc, the krpc is n= eeded for any RPC program that wants to use netlink, as I understand it. (The other RPC utilities that used to do RPCs over AF_LOCAL are all N= FS related, so the krpc being loaded is a given.) For any more info than the above, glebius@ will have to explain it. rick
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAM5tNy6-xtDYQPw6vr588e2r=tX76pWZnKPczwaCrZ5j5XnCEw>