History log of /freebsd-current/lib/libc/rpc/clnt_dg.c
Revision Date Author Comments
# 5b31cc94 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

sccs: Manual changes

For the uncommon items: Go through the tree and remove sccs tags that
didn't fit any nice pattern. If in the neighborhood, other SCM tags were
removed when they were detritis of long-ago CVS somehow in the early
mists of the project. Some adjacent copyrights stringswere removed (they
duplicated the copyright notices in the file). This also removed
non-standard formations of omission of SCCS tags (usually by adding an
extra #if 0 somewhere.

After this commit, a number of strings tagged with the 'what' @(#)
prefix remain, but they are primarily copyright notices.

Sponsored by: Netflix


# dc36d6f9 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

lib: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# 24938f93 10-Nov-2023 Alan Somers <asomers@FreeBSD.org>

lib/libc/rpc: switch the per-fd structs in clnt_{dg,vc}.c to RB Trees

This saves oodles of memory, especially when "ulimit -n" is large. It
also prevents a buffer overflow if getrlimit should fail.

Also replace per-fd condvars with mutexes to simplify the code.

PR: 274968
MFC after: 2 weeks
Sponsored by: Axcient
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D42597


# a5c2f4e9 09-Nov-2023 Alan Somers <asomers@FreeBSD.org>

libc/libc/rpc: refactor some global variables

* Combine dg_fd_locks and dg_cv into one array.
* Similarly for vc_fd_locks and vc_cv
* Turn some macros into inline functions

This is a mostly cosmetic change to make refactoring these strutures in
a future commit easier.

MFC after: 2 weeks
Sponsored by: Axcient
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D42597


# 559a218c 01-Nov-2023 Warner Losh <imp@FreeBSD.org>

libc: Purge unneeded cdefs.h

These sys/cdefs.h are not needed. Purge them. They are mostly left-over
from the $FreeBSD$ removal. A few in libc are still required for macros
that cdefs.h defines. Keep those.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D42385


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 0d55bc8e 22-Aug-2021 Gordon Bergling <gbe@FreeBSD.org>

rpc(3): Correct a few common typos in source code comments

- s/therfore/therefor/
- s/activte/active/

Obtained from: NetBSD
MFC after: 3 days


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# 32223c1b 29-Apr-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

libc: spelling fixes.

Mostly on comments.


# 68895e38 31-Aug-2015 Craig Rodrigues <rodrigc@FreeBSD.org>

Use ANSI C prototypes.

Eliminates gcc 4.9 warnings.


# 2b1474fd 17-Feb-2015 Pedro F. Giffuni <pfg@FreeBSD.org>

libc: clean some set-but-not-used errors.

These were found by gcc 5.0 on Dragonfly BSD, however I
made no attempt to silence the false positives.

Obtained from: DragonFly (cf515c3a6f3a8964ad592e524442bc628f8ed63b)


# 2e322d37 25-Nov-2013 Hiroki Sato <hrs@FreeBSD.org>

Replace Sun RPC license in TI-RPC library with a 3-clause BSD license,
with the explicit permission of Sun Microsystems in 2009.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 3d3ec676 15-Sep-2008 Doug Rabson <dfr@FreeBSD.org>

Fix async mode (required for ypbind in manycast mode).


# 8f55a568 06-Aug-2008 Doug Rabson <dfr@FreeBSD.org>

Add an implementation of the RPCSEC_GSS authentication protocol for RPC. This
is based on an old implementation from the University of Michigan with lots of
changes and fixes by me and the addition of a Solaris-compatible API.

Sponsored by: Isilon Systems
Reviewed by: alfred


# 3dd425f7 03-Mar-2007 Simon L. B. Nielsen <simon@FreeBSD.org>

Disable RPC exponential back-off for FreeBSD.org systems (IE. hidden
behind _FREEFALL_CONFIG). This is done mainly to make NIS even more
resistant to packet loss.

This is not enabled by default for "normal" FreeBSD since it might cause
the server providing the RPC service to be hit heavily with RPC traffic
in case of problems. freefall.FreeBSD.org and hub.FreeBSD.org have been
running with a patch similar to this for a couple of weeks.

MFC after: 1 week
Discussed with: peter


# 235baf26 27-Feb-2006 Daniel Eischen <deischen@FreeBSD.org>

Staticize a couple of functions.

Remove a few unused locks.

Remove locks from application namespace.


# a986ef57 16-Oct-2004 David E. O'Brien <obrien@FreeBSD.org>

Try to bring some sanity to the SCM ID's.
+ spell LIBC_SCCS consistently
+ enable builds with LIBC_SCCS defined to not syntax error
+ minor SCM reformatting to try to have some consistency


# f4a180cc 29-Oct-2003 Martin Blapp <mbr@FreeBSD.org>

Make this part identical with NetBSD: Use recvlen instead of inlen.
No functionality change.

Obtained from: NetBSD


# d7cd6ba3 15-Oct-2002 Ian Dowse <iedowse@FreeBSD.org>

Use kqueue(2) instead of poll(2) to wait for replies and timeouts
in the UDP RPC client code. As a side-effect, this fixes some bugs
that might prevent the RPC call from ever timing out for example
if the server keeps responding with the wrong xid. This could
probably be simplified further by using the EVFILT_TIMER filter.


# cffc0b57 14-Jul-2002 Alfred Perlstein <alfred@FreeBSD.org>

Silence several warnings due to functions that needed to take a void *
having a char * as an argument instead. clnt_dg_control(), clnt_raw_control(),
clnt_vc_control().


# f249dbcc 28-Apr-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Spell void * as void * rather than caddr_t. This is complicated by the
fact that caddr_t is often misspelled as char *.

Sponsored by: DARPA, NAI Labs


# d3d20c82 22-Mar-2002 David E. O'Brien <obrien@FreeBSD.org>

Fix the style of the SCM ID's.
I believe have made all of libc .c's as consistent as possible.


# 1372519b 22-Mar-2002 David E. O'Brien <obrien@FreeBSD.org>

Remove multi-line __P() usage.


# c05ac53b 21-Mar-2002 David E. O'Brien <obrien@FreeBSD.org>

Remove __P() usage.


# fd8e4ebc 18-Feb-2002 Mike Barcroft <mike@FreeBSD.org>

o Move NTOHL() and associated macros into <sys/param.h>. These are
deprecated in favor of the POSIX-defined lowercase variants.
o Change all occurrences of NTOHL() and associated marcros in the
source tree to use the lowercase function variants.
o Add missing license bits to sparc64's <machine/endian.h>.
Approved by: jake
o Clean up <machine/endian.h> files.
o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>.
o Remove prototypes for non-existent bswapXX() functions.
o Include <machine/endian.h> in <arpa/inet.h> to define the
POSIX-required ntohl() family of functions.
o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>,
and <sys/param.h>.
o Prepend underscores to the ntohl() family to help deal with
complexities associated with having MD (asm and inline) versions, and
having to prevent exposure of these functions in other headers that
happen to make use of endian-specific defines.
o Create weak aliases to the canonical function name to help deal with
third-party software forgetting to include an appropriate header.
o Remove some now unneeded pollution from <sys/types.h>.
o Add missing <arpa/inet.h> includes in userland.

Tested on: alpha, i386
Reviewed by: bde, jake, tmm


# 8d630135 05-Feb-2002 Alfred Perlstein <alfred@FreeBSD.org>

Fix cc -Wall, fix rcsid warnings, add missing prototypes,
change prototypes to be the same as in the original sun tirpc code.
Remove ()P macro in a file where the mayority had ()P already removed.
Add them if the mayority use ()P macros.

Submitted by: mbr
Requested by: bde


# 32de72d2 23-Jun-2001 Ian Dowse <iedowse@FreeBSD.org>

Add a new clnt_control() request `CLSET_CONNECT' that controls
whether or not connect(2) is used for UDP client sockets. The default
is not to connect(), so existing clients will see no change in
behaviour.

The use of connect(2) for UDP clients has a number of advantages:
only replies from the intended address are received, and ICMP errors
pertaining to the connection are reported back to the application.


# a9d09e93 18-May-2001 Ian Dowse <iedowse@FreeBSD.org>

The function clnt_dg_call(), which is used for UDP RPC calls, could
accidentally clobber the server address if a stray packet arrived
at the client port. This would result in any further retransmits
going to the wrong address.

For now, fix this by not saving the source address of the reply; this
matches the pre-tirpc behaviour.


# c6229223 03-Apr-2001 Ian Dowse <iedowse@FreeBSD.org>

Remove some hacks that were apparently added to avoid problems with
RPC clients hanging. The real problem turned out to be missing
cleanup code; this was fixed in clnt_vc.c r1.5 and clnt_dg.c r1.4.

Submitted by: Martin Blapp <mb@imp.ch>


# cd517469 02-Apr-2001 Ian Dowse <iedowse@FreeBSD.org>

There were a few error cases where the RPC code would return with
all signals masked (whoops). Add the missing cleanup code.

Reviewed by: Martin Blapp <mb@imp.ch>, alfred


# 9f5afc13 02-Apr-2001 Ian Dowse <iedowse@FreeBSD.org>

Move the #includes of reentrant.h to after the `#include "namespace.h"',
so that the underscored versions of the pthread functions get
declared. This removes around 300 lines of 'implicit declaration
of XXX' warnings from the output of a libc build with -Wall.

Reviewed by: Martin Blapp <mb@imp.ch>, alfred


# 65d3c627 27-Mar-2001 Bill Paul <wpaul@FreeBSD.org>

Add a CLSET_ASYNC command, which allows us to (ab)use the clnt_dg transport
to make asynchronous RPCs. This is needed to help fix ypbind, which can no
longer override the clnt_dg_call() method (formerly the clntudp_call()
method) due to all the internal descriptor locking code in TI-RPC. Turning
on this flag allows us to send an RPC request, then return immediately,
and handle a reply later, rather than being forced to do the request
and reply in a single function call.

Also fix a byte ordering bug: when clnt_dg_call() increments the XID
prior to transmitting a request, it uses the raw value, which is wrong.
The XID is stored in network byte order, i.e. big-endian. The CLSET_XID
and CLGET_XID commands in clnt_dg_control() use ntohl()/htonl() to get
the byte ordering right, but because clnt_dg_call() does not do this,
using CLSET_XID/CLGET_XID doesn't actually work, unless you're on a
big endian host, which we aren't (yet). Fix clnt_dg_call() to byte swap
properly when doing the increment.


# 8360efbd 18-Mar-2001 Alfred Perlstein <alfred@FreeBSD.org>

Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) and
associated changes that had to happen to make this possible as well as
bugs fixed along the way.

Bring in required TLI library routines to support this.

Since we don't support TLI we've essentially copied what NetBSD
has done, adding a thin layer to emulate direct the TLI calls
into BSD socket calls.

This is mostly from Sun's tirpc release that was made in 1994,
however some fixes were backported from the 1999 release (supposedly
only made available after this porting effort was underway).

The submitter has agreed to continue on and bring us up to the
1999 release.

Several key features are introduced with this update:
Client calls are thread safe. (1999 code has server side thread
safe)
Updated, a more modern interface.

Many userland updates were done to bring the code up to par with
the recent RPC API.

There is an update to the pthreads library, a function
pthread_main_np() was added to emulate a function of Sun's threads
library.

While we're at it, bring in NetBSD's lockd, it's been far too
long of a wait.

New rpcbind(8) replaces portmap(8) (supporting communication over
an authenticated Unix-domain socket, and by default only allowing
set and unset requests over that channel). It's much more secure
than the old portmapper.

Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded
to support TI-RPC and to support IPV6.

Umount(8) is also fixed to unmount pathnames longer than 80 chars,
which are currently truncated by the Kernel statfs structure.

Submitted by: Martin Blapp <mb@imp.ch>
Manpage review: ru
Secure RPC implemented by: wpaul