diff options
author | brian <brian@FreeBSD.org> | 1998-05-23 22:24:50 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1998-05-23 22:24:50 +0000 |
commit | 7f9f3d4b006fb3ffffcebd44183520742fa0bf6f (patch) | |
tree | d9eda8d3412bab2407741e40c3e4b78839fe30ed /usr.sbin/ppp/mp.c | |
parent | 3d5a66dff7468559eb0f226477cfed7891ba121f (diff) | |
download | FreeBSD-src-7f9f3d4b006fb3ffffcebd44183520742fa0bf6f.zip FreeBSD-src-7f9f3d4b006fb3ffffcebd44183520742fa0bf6f.tar.gz |
o Move our prompt descriptor list outside of the bundle.
It's now dealt with by the `server' object. This simplifies
things as we only have one list of prompt descriptors and
the log_ routines check prompt::logactive to determine
whether it should be used for output.
o Include the MP socket UpdateSet() result in bundle::UpdateSet().
o Don't select on the tun device unless we're in NETWORK
phase or AUTO mode.
o Stop the idle timer when we go to DEAD phase. We may
have transferred a link and not had a chance to kill
it.
o Don't fail when trying to unlink our transferred datalink
from our descriptor lists just before the transfer.
o Add our link descriptor to the write set if we got a short
write the last time (physical::out is set).
o Log the connection source address when a connection is closed.
o Remove descriptor::next field. Descriptor lists are not required
any more.
Diffstat (limited to 'usr.sbin/ppp/mp.c')
-rw-r--r-- | usr.sbin/ppp/mp.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.sbin/ppp/mp.c b/usr.sbin/ppp/mp.c index 4532f6e..429a01a 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.3 1998/05/23 13:38:09 brian Exp $ + * $Id: mp.c,v 1.4 1998/05/23 17:05:28 brian Exp $ */ #include <sys/types.h> @@ -850,28 +850,30 @@ mpserver_UpdateSet(struct descriptor *d, fd_set *r, fd_set *w, fd_set *e, int *n) { struct mpserver *s = descriptor2mpserver(d); + int result; + result = 0; if (s->send.dl != NULL) { /* We've connect()ed */ if (!link_QueueLen(&s->send.dl->physical->link) && !s->send.dl->physical->out) { /* Only send if we've transmitted all our data (i.e. the ConfigAck) */ - datalink_RemoveFromSet(s->send.dl, r, w, 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 ! */ - datalink_RemoveFromSet(s->send.dl, r, NULL, NULL); + result -= datalink_RemoveFromSet(s->send.dl, r, NULL, NULL); } else if (r && s->fd >= 0) { if (*n < s->fd + 1) *n = s->fd + 1; FD_SET(s->fd, r); log_Printf(LogTIMER, "mp: fdset(r) %d\n", s->fd); - return 1; + result++; } - return 0; + return result; } static int @@ -912,7 +914,6 @@ void mpserver_Init(struct mpserver *s) { s->desc.type = MPSERVER_DESCRIPTOR; - s->desc.next = NULL; s->desc.UpdateSet = mpserver_UpdateSet; s->desc.IsSet = mpserver_IsSet; s->desc.Read = mpserver_Read; |