programs (like rshd or rlogind).
bindresvport() and bindresvport_sa() exhibits exactly the same functionality,
with different function prototype (sockaddr_in * and sockaddr *).
The behavior and prototype was discussed and agreed among shin@kame.net
(who is doing freebsd-current kame merge), deraadt@openbsd.org, and
Jean-Luc.Richier@imag.fr (INRIA IPv6/IPv6 RPC support). so it will be
portable across *bsd.
page needs a lot of help:
- restructure it into xdr_admin(3), xdr_complex(3), xdr_create(3), and
xdr_simple(3), as is done in Solaris.
- rewrite in mandoc, and document all of the XDR primitives that NetBSD
actually supplies.
- xdr_int64_t(), xdr_u_int64_t(), per NetBSD convention.
- xdr_hyper(), xdr_u_hyper(), xdr_longlong_t(), xdr_u_longlong_t(), a'la
Solaris, implemented in terms of the above.
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.
the first two items result in the addition of code similar to the
following in various functions:
_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
* note (in the comments) that the client is responsible for closing
the socket if they opened it, or they didn't use CLNT_DESTROY()
fixes a couple of unnecessary closing of already-closed sockets.
noted by: Matthias Drochner <M.Drochner@fz-juelich.de>
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
- bump listen backlog to a modern value (should fix [lib/6379])
- always check if sock should be closed
- provide more informative error messages
* svctcp_rev(); set strm_stat = XPRT_DIED if error (from freebsd)
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos