summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/mp.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1998-05-25 02:22:38 +0000
committerbrian <brian@FreeBSD.org>1998-05-25 02:22:38 +0000
commit02218556c6995f24069e2dc1ca9533572cd1c70e (patch)
tree8533006e9326a5a8d8e768c905871e42dd0b4cd0 /usr.sbin/ppp/mp.c
parent631316592f05d5ef85d9d819cb08570b9b8cd481 (diff)
downloadFreeBSD-src-02218556c6995f24069e2dc1ca9533572cd1c70e.zip
FreeBSD-src-02218556c6995f24069e2dc1ca9533572cd1c70e.tar.gz
o Don't try to transfer tty device descriptors as there's no way of
transferring session rights with them. Instead, create two `/bin/cat' processes. A new child is spawned and disassociated from the terminal and the parent, which continues with the rest of the ppp process. Meanwhile, the parent spawns another child, and both the parent and child exec the `/bin/cat' commands with the appropriate descriptors. This way, the session is owned by the parent, and the tty is held open. o Close LCPs that have done a TLF and are now in ST_STOPPED before calling Down. This prevents them from trying to come back up again after the peer has shut them down (it seems a bit strange that the rfc says that a Down in ST_STOPPED will cause a TLS etc). o Don't try to set the physical link name pointer when we're receiving and renaming a datalink. The physical hasn't been created yet, and as it happens, the garbage physical pointer happens to be the value of another physical - so we're pointing that other physical name at ourselves. yeuck. o Re-arrange the order of things in main (DoLoop()). We now handle signals only after the select and not before the UpdateSet. It's possible that either a signal (FSM timeout) or a descriptor_Read() brings a link down, after which we'd better tidy up any dead direct and 1off descriptors before calling UpdateSet() again. o Mention when we detect a PPP packet when we see one before the link is up (then start LCP as before).
Diffstat (limited to 'usr.sbin/ppp/mp.c')
-rw-r--r--usr.sbin/ppp/mp.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.sbin/ppp/mp.c b/usr.sbin/ppp/mp.c
index 429a01a..65ccfc0 100644
--- a/usr.sbin/ppp/mp.c
+++ b/usr.sbin/ppp/mp.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mp.c,v 1.4 1998/05/23 17:05:28 brian Exp $
+ * $Id: mp.c,v 1.5 1998/05/23 22:24:46 brian Exp $
*/
#include <sys/types.h>
@@ -861,7 +861,6 @@ mpserver_UpdateSet(struct descriptor *d, fd_set *r, fd_set *w, fd_set *e,
result -= datalink_RemoveFromSet(s->send.dl, r, w, e);
bundle_SendDatalink(s->send.dl, s->fd, &s->socket);
s->send.dl = NULL;
- close(s->fd);
s->fd = -1;
} else
/* Never read from a datalink that's on death row ! */
@@ -899,8 +898,8 @@ mpserver_Read(struct descriptor *d, struct bundle *bundle, const fd_set *fdset)
if (in.sa_family == AF_LOCAL)
bundle_ReceiveDatalink(bundle, fd, (struct sockaddr_un *)&in);
-
- close(fd);
+ else
+ close(fd);
}
static void
@@ -994,7 +993,6 @@ mpserver_Close(struct mpserver *s)
if (s->send.dl != NULL) {
bundle_SendDatalink(s->send.dl, s->fd, &s->socket);
s->send.dl = NULL;
- close(s->fd);
s->fd = -1;
} else if (s->fd >= 0) {
close(s->fd);
OpenPOWER on IntegriCloud