summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/ip.c
diff options
context:
space:
mode:
authoramurai <amurai@FreeBSD.org>1995-03-11 15:18:55 +0000
committeramurai <amurai@FreeBSD.org>1995-03-11 15:18:55 +0000
commit4e41b74b9d21768a96f51254ed346d04bb4405af (patch)
tree37ea926bbfbf0a7fb4adb214f5262d8872ba5a52 /usr.sbin/ppp/ip.c
parent9b4b6386ecfab11f456999cadd482f36e97e6938 (diff)
downloadFreeBSD-src-4e41b74b9d21768a96f51254ed346d04bb4405af.zip
FreeBSD-src-4e41b74b9d21768a96f51254ed346d04bb4405af.tar.gz
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
Diffstat (limited to 'usr.sbin/ppp/ip.c')
-rw-r--r--usr.sbin/ppp/ip.c23
1 files changed, 18 insertions, 5 deletions
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()
{
OpenPOWER on IntegriCloud