FreeBSD src
Go to file
Brian Somers 2cb305af77 Rewrite the link descriptor transfer code in MP mode.
Previously, ppp attempted to bind() to a local domain tcp socket
based on the peer authname & enddisc.  If it succeeded, it listen()ed
and became MP server.  If it failed, it connect()ed and became MP
client.  The server then select()ed on the descriptor, accept()ed
it and wrote its pid to it then read the link data & link file descriptor,
and finally sent an ack (``!'').  The client would read() the server
pid, transfer the link lock to that pid, send the link data & descriptor
and read the ack.  It would then close the descriptor and clean up.

There was a race between the bind() and listen() where someone could
attempt to connect() and fail.

This change removes the race.  Now ppp makes the RCVBUF big enough on a
socket descriptor and attempts to bind() to a local domain *udp* socket
(same name as before).  If it succeeds, it becomes MP server.  If it
fails, it sets the SNDBUF and connect()s, becoming MP client.  The server
select()s on the descriptor and recvmsg()s the message, insisting on at
least two descriptors (plus the link data).  It uses the second descriptor
to write() its pid then read()s an ack (``!'').  The client creates a
socketpair() and sendmsg()s the link data, link descriptor and one of
the socketpair descriptors.  It then read()s the server pid from the
other socketpair descriptor, transfers any locks and write()s an ack.

Now, there can be no race, and a connect() failure indicates a stale
socket file.

This also fixes MP ppp over ethernet, where the struct msghdr was being
misconstructed when transferring the control socket descriptor.

Also, if we fail to send the link, don't hang around in a ``session
owner'' state, just do the setsid() and fork() if it's required to
disown a tty.

UDP idea suggested by: Chris Bennet from Mindspring at FreeBSDCon
1999-11-25 02:47:04 +00:00
bin Correct use of .Nm. Add DIAGNOSTICS section. Add rcsid 1999-11-21 16:11:56 +00:00
contrib This commit was generated by cvs2svn to compensate for changes in r53660, 1999-11-24 06:24:35 +00:00
crypto Merge anf fix for build. 1999-09-19 21:56:09 +00:00
etc Make the devices for the endpoints 0-15, not only for 0. This creates 1999-11-24 21:05:59 +00:00
games Fix breakage in previous commit. 1999-11-16 12:10:29 +00:00
gnu GNU killed this sometime before 2.3. 1999-11-24 15:11:51 +00:00
include Add FNM_FILE_NAME - GNU alias to FNM_PATHNAME 1999-11-21 17:32:45 +00:00
kerberos5 Bring in SRA for telnet. 1999-10-07 18:59:55 +00:00
kerberosIV Bring in SRA for telnet. 1999-10-07 18:59:55 +00:00
lib General clean-up of socket.h and associated sources to synchronise up 1999-11-24 20:49:04 +00:00
libexec Add a ``-P pidfile'' option 1999-11-23 00:21:20 +00:00
release Clean up the loader.conf write-out code. 1999-11-24 09:45:36 +00:00
sbin rewire userland ipfilter programs 1999-11-23 21:57:29 +00:00
secure Dont build telenet if we are going for kerberised telnet; this just 1999-10-12 19:48:05 +00:00
share Add one of the two root words adapted from scandinavian since 1066: 1999-11-24 07:16:17 +00:00
sys Add the description for the configuration of GUS non-PnP bridge driver. 1999-11-25 01:20:29 +00:00
tools Bring ``ac'' into reality. This great tools now works correctly (for 1999-11-04 08:45:02 +00:00
usr.bin Adjust man page: if command is specified, file name is mandatory 1999-11-24 15:47:45 +00:00
usr.sbin Rewrite the link descriptor transfer code in MP mode. 1999-11-25 02:47:04 +00:00
COPYRIGHT Update to add the July 22, 1999 addendum. 1999-09-05 21:33:47 +00:00
Makefile Remove a comment about setting objformat to elf by default. We've 1999-09-18 08:27:55 +00:00
Makefile.inc0 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
Makefile.inc1 Revert to rev 1.91. Revs 1.9{2,3} were causing problems for people with 1999-11-24 06:04:11 +00:00
Makefile.upgrade $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
README $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
UPDATING Spelling fix. 1999-11-19 02:16:26 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel and the contents of /etc.  Please see the top of the Makefile
in this directory for more information on the standard build targets
and compile-time flags.

Building a kernel with config(8) is a somewhat more involved process,
documentation for which can be found at:
   http://www.freebsd.org/handbook/kernelconfig.html
And in the config(8) man page.

The sample kernel configuration files reside in the sys/i386/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file LINT contains entries for all possible devices, not
just those commonly used, and is meant more as a general reference
than an actual kernel configuration file (a kernel built from it
wouldn't even run).


Source Roadmap:
---------------
bin		System/User commands.

contrib		Packages contributed by 3rd parties.

crypto		Export controlled stuff (see crypto/README).

etc		Template files for /etc

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberosIV	Kerberos package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

sbin		System commands.

secure		DES and DES-related utilities - NOT FOR EXPORT!

share		Shared resources.

sys		Kernel sources.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/handbook/synching.html