freebsd with flexible iflib nic queues
Go to file
Bill Paul a230877213 Make _yp_dobind() a litle smarter:
Now that we preserve RPC handles instead of rebuilding them each time
a ypcln function is called, we have to be careful about keeping our sockets
in a sane state. It's possible that the caller may call a ypclnt
function, and then decide to close all its file descriptors. This would
also close the socket descriptor held by the yplib code. Worse, it
could re-open the same descriptor number for its own use. If it then calls
another ypclnt function, the subsequent RPC will fail because the socket
will either be gone or replaced with Something Completely Different. The
yplib code will recover by rebinding, but it doing so it may wreck the
descriptor which now belongs to the caller.

To fix this, _yp_dobind() needs to label the descriptor somehow so
that it can test it later to make sure it hasn't been altered between
ypclnt calls. It does this by binding the socket, thus associating a port
number with it. It then saves this port number in the dom_local_port member
of the dom_binding structure for the given domain. When _yp_dobind() is
called again (which it is at the start of each ypclnt function), it checks
to see if the domain is already bound, and if it is, it does a getsockname()
on the socket and compares the port number to the one it saved. If the
getsockname() fails, or the port number doesn't match, it abandons the
socket and sets up a new client handle.

This still incurs some syscall overhead, which is what I was trying to
avoid, but it's still not as bad as before.
1996-06-01 05:08:31 +00:00
bin Use new yacc rules. (I'm fixing the tree as fast as I can :-) 1996-05-30 20:52:26 +00:00
eBones Localize time 1996-05-07 19:05:10 +00:00
etc Eliminate warning message and add big warnings about security holes 1996-05-22 05:43:30 +00:00
games Use new yacc rule. 1996-05-30 20:56:23 +00:00
gnu Reviewed by: joerg 1996-06-01 03:19:59 +00:00
include Protocol definitions for RIPv2. 1996-05-30 16:31:04 +00:00
lib Make _yp_dobind() a litle smarter: 1996-06-01 05:08:31 +00:00
libexec Use the sysctl settable data port ranges rather than the statically 1996-05-31 03:10:25 +00:00
lkm `mv'' -> `mv -f'' 1996-05-07 23:19:49 +00:00
release Put .inf files directly into distributions so that sysinstall can find them. 1996-05-29 04:13:17 +00:00
sbin Return make_union, s-bit removed 1996-05-19 17:24:10 +00:00
secure Localize time 1996-05-07 19:05:10 +00:00
share Mention that the default update time of 30 seconds may be 1996-05-31 21:02:16 +00:00
sys Fix ioctl() operations...nasty typo 1996-05-31 17:35:07 +00:00
tools Don't look in libkern, it went away. 1995-12-29 01:51:23 +00:00
usr.bin yacc rules change. 1996-05-30 23:09:11 +00:00
usr.sbin Small touch-ups -- no functional changes. 1996-05-31 16:01:51 +00:00
COPYRIGHT
Makefile 1) make -DCLOBBER not remove most of /usr/lib 1996-05-04 07:12:07 +00:00