Subject: Re: pppoe LCP keepalive timer lossage
To: Martin Husemann <martin@duskware.de>
From: Jesse Off <joff@stchome.com>
List: tech-kern
Date: 08/25/2003 08:23:39
On Mon, 25 Aug 2003, Martin Husemann wrote:
> On Sun, Aug 24, 2003 at 09:36:40PM -0700, Jesse Off wrote:
>
> Anyway - you have not shown that this would actually solve your
problem.
> Did your tcpdump while looking for LCP echo requests show any PPPoE traffic?
> Did it show incoming traffic?
My tcpdump was "tcpdump -i pppoe0 not ip" so it didn't catch any of the IP
packets that may have gone through. I believe this patch fixes my
problem. Basically, with this we only send LCP echo's (and expect a
reply) if we haven't received a packet on the interface for >10 seconds.
//Jesse Off
Index: if_spppsubr.c
===================================================================
RCS file: /cvsroot/src/sys/net/if_spppsubr.c,v
retrieving revision 1.46.4.19
diff -u -r1.46.4.19 if_spppsubr.c
--- if_spppsubr.c 2003/07/10 15:40:45 1.46.4.19
+++ if_spppsubr.c 2003/08/25 15:14:41
@@ -613,6 +613,7 @@
schednetisr(NETISR_IP);
inq = &ipintrq;
sp->pp_last_activity = mono_time.tv_sec;
+ sp->pp_last_receive = mono_time.tv_sec;
}
break;
#endif
@@ -628,6 +629,7 @@
schednetisr(NETISR_IPV6);
inq = &ip6intrq;
sp->pp_last_activity = mono_time.tv_sec;
+ sp->pp_last_receive = mono_time.tv_sec;
}
break;
#endif
@@ -4687,7 +4689,7 @@
continue;
/* No echo reply, but maybe user data passed through? */
- if ((now - sp->pp_last_activity) < LCP_KEEPALIVE_INTERVAL) {
+ if ((now - sp->pp_last_receive) < LCP_KEEPALIVE_INTERVAL) {
sp->pp_alivecnt = 0;
continue;
}
Index: if_spppvar.h
===================================================================
RCS file: /cvsroot/src/sys/net/if_spppvar.h,v
retrieving revision 1.4.8.3
diff -u -r1.4.8.3 if_spppvar.h
--- if_spppvar.h 2003/01/28 18:28:22 1.4.8.3
+++ if_spppvar.h 2003/08/25 15:14:41
@@ -86,6 +86,7 @@
u_long pp_seq[IDX_COUNT]; /* local sequence number */
u_long pp_rseq[IDX_COUNT]; /* remote sequence number */
u_quad_t pp_saved_mtu; /* saved MTU value */
+ time_t pp_last_receive; /* second of last payload data rcv */
time_t pp_last_activity; /* second of last payload data s/r */
time_t pp_idle_timeout; /* idle seconds before auto-disconnect,
* 0 = disabled */