From 4e41b74b9d21768a96f51254ed346d04bb4405af Mon Sep 17 00:00:00 2001 From: amurai Date: Sat, 11 Mar 1995 15:18:55 +0000 Subject: 1.Reducing cpu usage at off connection. 2.Implment Redail function as working correctly. 3.Clean up a code as I notice. 4.Now, RTT getting close to 50ms with ISDN/TA 38400bps !! Reviewed by: amurai@spec.co.jp Submitted by: amurai@spec.co.jp --- usr.sbin/ppp/ip.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'usr.sbin/ppp/ip.c') diff --git a/usr.sbin/ppp/ip.c b/usr.sbin/ppp/ip.c index 9e2ad62..c0dd7e8 100644 --- a/usr.sbin/ppp/ip.c +++ b/usr.sbin/ppp/ip.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id:$ + * $Id: ip.c,v 1.2 1995/02/26 12:17:33 amurai Exp $ * * TODO: * o Return ICMP message for filterd packet @@ -75,7 +75,6 @@ static void RestartIdleTimer() { if (!(mode & MODE_DEDICATED) && ipKeepAlive ) { -/* StopTimer(&IdleTimer); */ StartTimer(&IdleTimer); ipIdleSecs = 0; } @@ -301,7 +300,7 @@ int direction; if (direction == 0) IcmpError(pip, pri); return(-1); } else { - if ( FilterCheck(pip, 3) & A_DENY ) { /* Check Keep Alive filter */ + if ( FilterCheck(pip, FL_KEEP ) & A_DENY ) { /* Check Keep Alive filter */ ipKeepAlive = FALSE; } else { ipKeepAlive = TRUE; @@ -327,7 +326,7 @@ struct mbuf *bp; /* IN: Pointer to IP pakcet */ nb += wp->cnt; } - if (PacketCheck(tunbuff, nb, 0) < 0) { + if ( PacketCheck(tunbuff, nb, FL_IN ) < 0) { pfree(bp); return; } @@ -355,7 +354,7 @@ int cnt; /* IN: Length of packet */ if (IpcpFsm.state != ST_OPENED) return; - pri = PacketCheck(ptr, cnt, 1); + pri = PacketCheck(ptr, cnt, FL_OUT); if (pri >= 0) { bp = mballoc(cnt, MB_IPIN); bcopy(ptr, MBUF_CTOP(bp), cnt); @@ -380,6 +379,20 @@ int count; Enqueue(&IpOutputQueues[pri], bp); } +int +IsIpEnqueued() +{ + struct mqueue *queue; + int exist = FALSE; + for (queue = &IpOutputQueues[PRI_URGENT]; queue >= IpOutputQueues; queue--) { + if ( queue->qlen > 0 ) { + exist = TRUE; + break; + } + } + return( exist ); +} + void IpStartOutput() { -- cgit v1.1