fix inverted timeout test
[l2tpns.git] / l2tpns.c
index 594b501..981372c 100644 (file)
--- a/l2tpns.c
+++ b/l2tpns.c
@@ -4,7 +4,7 @@
 // Copyright (c) 2002 FireBrick (Andrews & Arnold Ltd / Watchfront Ltd) - GPL licenced
 // vim: sw=8 ts=8
 
-char const *cvs_id_l2tpns = "$Id: l2tpns.c,v 1.116 2005/08/10 07:25:24 bodea Exp $";
+char const *cvs_id_l2tpns = "$Id: l2tpns.c,v 1.118 2005/08/10 08:36:48 bodea Exp $";
 
 #include <arpa/inet.h>
 #include <assert.h>
@@ -2233,16 +2233,12 @@ void processudp(uint8_t *buf, int len, struct sockaddr_in *addr)
                                case 31:    // Proxy Authentication Challenge
                                        {
                                                LOG(4, s, t, "   Proxy Auth Challenge\n");
-                                               if (sess_local[s].radius)
-                                                       memcpy(radius[sess_local[s].radius].auth, b, 16);
                                                break;
                                        }
                                case 32:    // Proxy Authentication ID
                                        {
                                                uint16_t authid = ntohs(*(uint16_t *)(b));
                                                LOG(4, s, t, "   Proxy Auth ID (%d)\n", authid);
-                                               if (sess_local[s].radius)
-                                                       radius[sess_local[s].radius].id = authid;
                                                break;
                                        }
                                case 33:    // Proxy Authentication Response
@@ -2719,7 +2715,7 @@ static void regular_cleanups(double period)
                }
 
                // PPP timeouts
-               if (sess_local[s].lcp.restart >= time_now)
+               if (sess_local[s].lcp.restart <= time_now)
                {
                        int next_state = session[s].ppp.lcp;
                        switch (session[s].ppp.lcp)
@@ -2750,7 +2746,7 @@ static void regular_cleanups(double period)
                                continue;
                }
 
-               if (sess_local[s].ipcp.restart >= time_now)
+               if (sess_local[s].ipcp.restart <= time_now)
                {
                        int next_state = session[s].ppp.ipcp;
                        switch (session[s].ppp.ipcp)
@@ -2781,7 +2777,7 @@ static void regular_cleanups(double period)
                                continue;
                }
 
-               if (sess_local[s].ipv6cp.restart >= time_now)
+               if (sess_local[s].ipv6cp.restart <= time_now)
                {
                        int next_state = session[s].ppp.ipv6cp;
                        switch (session[s].ppp.ipv6cp)
@@ -2809,7 +2805,7 @@ static void regular_cleanups(double period)
                        }
                }
 
-               if (sess_local[s].ccp.restart >= time_now)
+               if (sess_local[s].ccp.restart <= time_now)
                {
                        int next_state = session[s].ppp.ccp;
                        switch (session[s].ppp.ccp)