projects
/
l2tpns.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
any traffic on a tunnel resets lastrec, not just control messages
[l2tpns.git]
/
l2tpns.c
diff --git
a/l2tpns.c
b/l2tpns.c
index
6e0c7ee
..
3a7d851
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
// 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.12
8 2005/09/02 23:59:56
bodea Exp $";
+char const *cvs_id_l2tpns = "$Id: l2tpns.c,v 1.12
9 2005/09/12 05:16:42
bodea Exp $";
#include <arpa/inet.h>
#include <assert.h>
#include <arpa/inet.h>
#include <assert.h>
@@
-1827,6
+1827,11
@@
void processudp(uint8_t *buf, int len, struct sockaddr_in *addr)
return;
}
l -= (p - buf);
return;
}
l -= (p - buf);
+
+ // used to time out old tunnels
+ if (t && tunnel[t].state == TUNNELOPEN)
+ tunnel[t].lastrec = time_now;
+
if (*buf & 0x80)
{ // control
uint16_t message = 0xFFFF; // message type
if (*buf & 0x80)
{ // control
uint16_t message = 0xFFFF; // message type
@@
-1914,9
+1919,6
@@
void processudp(uint8_t *buf, int len, struct sockaddr_in *addr)
return;
}
return;
}
- // This is used to time out old tunnels
- tunnel[t].lastrec = time_now;
-
// check sequence of this message
{
int skip = tunnel[t].window; // track how many in-window packets are still in queue
// check sequence of this message
{
int skip = tunnel[t].window; // track how many in-window packets are still in queue