Subject: kern/17665: kern pppoe hoses nailed connections if can't connect at boot
To: None <gnats-bugs@gnats.netbsd.org>
From: None <tv@pobox.com>
List: netbsd-bugs
Date: 07/20/2002 14:34:37
>Number:         17665
>Category:       kern
>Synopsis:       kern pppoe hoses nailed connections if can't connect at boot
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 20 11:35:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Todd Vierling
>Release:        NetBSD 1.6_BETA4 (also affects -current)
>Organization:
>Environment:

>Description:

The kernelized PPPoE is set up such that dial-on-demand connections will
only try a rapid set of connect attempts once, then quit.  However, it
*also* applies this behavior to non-demand links (intended to be nailed
up), if such an interface hasn't been conencted since boot -- which
completely hoses nailed pppoe links if the first connect attempt at boot
time fails.

This is listed as a sw-bug, NOT a change-request, as the existing behavior
creates an indeterminate state for pppoe after a boot.

>How-To-Repeat:

Configure pppoe to start up at boot as described in pppoe(4).  Unplug the
DSL link.  Reboot.  Let machine boot, plug DSL link back in, and see that
pppoe does not retry the connection.

>Fix:

Attached are -current and 1.6-branch patches to fix this lossage and make
nailed connections actually behave as nailed connections.  Please consider
making this part of 1.6.1.

===== -current diff =====
Index: if_pppoe.c
===================================================================
RCS file: /cvsroot/syssrc/sys/net/if_pppoe.c,v
retrieving revision 1.32
diff -u -r1.32 if_pppoe.c
--- if_pppoe.c	2002/06/22 17:41:23	1.32
+++ if_pppoe.c	2002/07/20 18:25:08
@@ -898,7 +898,7 @@
 		 *    established and will try infinitely (without user
 		 *    intervention)
 		 * We only enter slow retry mode if IFF_LINK1 (aka autodial)
-		 * is not set and we already had a successfull connection.
+		 * is not set.
 		 */
 
 		/* initialize for quick retry mode */
@@ -907,8 +907,7 @@
 		x = splnet();
 		sc->sc_padi_retried++;
 		if (sc->sc_padi_retried >= PPPOE_DISC_MAXPADI) {
-			if ((sc->sc_sppp.pp_if.if_flags & IFF_LINK1) == 0 &&
-			    sc->sc_sppp.pp_if.if_ibytes) {
+			if ((sc->sc_sppp.pp_if.if_flags & IFF_LINK1) == 0) {
 				/* slow retry mode */
 				retry_wait = PPPOE_SLOW_RETRY;
 			} else {
===== END -current diff =====

===== 1.6-branch diff =====
Index: if_pppoe.c
===================================================================
RCS file: /cvsroot/syssrc/sys/net/if_pppoe.c,v
retrieving revision 1.24
diff -u -r1.24 if_pppoe.c
--- if_pppoe.c	2002/04/14 12:24:28	1.24
+++ if_pppoe.c	2002/07/20 18:22:56
@@ -826,7 +826,7 @@
 		 *    established and will try infinitely (without user
 		 *    intervention)
 		 * We only enter slow retry mode if IFF_LINK1 (aka autodial)
-		 * is not set and we already had a successfull connection.
+		 * is not set.
 		 */
 
 		/* initialize for quick retry mode */
@@ -835,8 +835,7 @@
 		x = splnet();
 		sc->sc_padi_retried++;
 		if (sc->sc_padi_retried >= PPPOE_DISC_MAXPADI) {
-			if ((sc->sc_sppp.pp_if.if_flags & IFF_LINK1) == 0
-			   && sc->sc_sppp.pp_if.if_ibytes) {
+			if ((sc->sc_sppp.pp_if.if_flags & IFF_LINK1) == 0) {
 			    /* slow retry mode */
 			    retry_wait = PPPOE_SLOW_RETRY;
 			} else {
===== END 1.6-branch diff =====
>Release-Note:
>Audit-Trail:
>Unformatted: