HomeFreeBSD

rpcsec_tls/client: use netlink RPC client to talk to rpc.tlsclntd(8)

Description

rpcsec_tls/client: use netlink RPC client to talk to rpc.tlsclntd(8)

In addition to using netlink(4) socket instead of unix(4) to pass
rpctlscd_* RPC commands to rpc.tlsclntd(8), the logic of passing file
descriptor is also changed. Since clnt_nl provides us all needed
parallelism and waits on individual RPC xids, we don't need to store
socket in a global variable and serialize all communication to the daemon.
Instead, we will augment rpctlscd_connect arguments with a cookie that is
basically a pointer to socket, that we keep for the daemon. While
sleeping on the request, we will store a database of all sockets
associated with rpctlscd_connect RPCs that we have sent to userland. The
daemon then will send us back the cookie in the
rpctls_syscall(RPCTLS_SYSC_CLSOCKET) argument and we will find and return
the socket for this upcall.

This will be optimized further in a separate commit, that will also touch
clnt_vc.c and other krpc files. This commit is intentionally made minimal,
so that it is easier to understand what changes with netlink(4) transport.

Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D48559

Details

Provenance
glebiusAuthored on Sat, Feb 1, 1:02 AM
Reviewer
rmacklem
Differential Revision
D48559: rpcsec_tls/client: use netlink RPC client to talk to rpc.tlsclntd(8)
Parents
rGb837f100e1c8: nfs: set vnet(9) context in mountnfs()
Branches
Unknown
Tags
Unknown