summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-06-08 11:58:27 +0000
committerbrian <brian@FreeBSD.org>1999-06-08 11:58:27 +0000
commita14b1bb88a8829d26a846e2479812aa1ed5685ab (patch)
tree3bfd57ce12decb7b9c4375b46a131062cafc3aa5 /usr.sbin/ppp
parentedabe1d262b956456335fc6a0c51d23ac7c1f6fa (diff)
downloadFreeBSD-src-a14b1bb88a8829d26a846e2479812aa1ed5685ab.zip
FreeBSD-src-a14b1bb88a8829d26a846e2479812aa1ed5685ab.tar.gz
Don't IPCP TLD if we're already doing it. This prevents
recursion by doing something like ``down'' or ``quit all'' in ppp.linkdown.
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r--usr.sbin/ppp/ipcp.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/usr.sbin/ppp/ipcp.c b/usr.sbin/ppp/ipcp.c
index 5d72e3f..768ef9b 100644
--- a/usr.sbin/ppp/ipcp.c
+++ b/usr.sbin/ppp/ipcp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: ipcp.c,v 1.78 1999/05/31 23:57:40 brian Exp $
+ * $Id: ipcp.c,v 1.79 1999/06/02 15:59:01 brian Exp $
*
* TODO:
* o Support IPADDRS properly
@@ -709,29 +709,33 @@ static void
IpcpLayerDown(struct fsm *fp)
{
/* About to come down */
+ static int recursing;
struct ipcp *ipcp = fsm2ipcp(fp);
const char *s;
- if (ipcp->fsm.bundle->iface->in_addrs)
- s = inet_ntoa(ipcp->fsm.bundle->iface->in_addr[0].ifa);
- else
- s = "Interface configuration error !";
- log_Printf(LogIPCP, "%s: LayerDown: %s\n", fp->link->name, s);
+ if (!recursing++) {
+ if (ipcp->fsm.bundle->iface->in_addrs)
+ s = inet_ntoa(ipcp->fsm.bundle->iface->in_addr[0].ifa);
+ else
+ s = "Interface configuration error !";
+ log_Printf(LogIPCP, "%s: LayerDown: %s\n", fp->link->name, s);
- /*
- * XXX this stuff should really live in the FSM. Our config should
- * associate executable sections in files with events.
- */
- if (system_Select(fp->bundle, s, LINKDOWNFILE, NULL, NULL) < 0) {
- if (bundle_GetLabel(fp->bundle)) {
- if (system_Select(fp->bundle, bundle_GetLabel(fp->bundle),
- LINKDOWNFILE, NULL, NULL) < 0)
- system_Select(fp->bundle, "MYADDR", LINKDOWNFILE, NULL, NULL);
- } else
- system_Select(fp->bundle, "MYADDR", LINKDOWNFILE, NULL, NULL);
- }
+ /*
+ * XXX this stuff should really live in the FSM. Our config should
+ * associate executable sections in files with events.
+ */
+ if (system_Select(fp->bundle, s, LINKDOWNFILE, NULL, NULL) < 0) {
+ if (bundle_GetLabel(fp->bundle)) {
+ if (system_Select(fp->bundle, bundle_GetLabel(fp->bundle),
+ LINKDOWNFILE, NULL, NULL) < 0)
+ system_Select(fp->bundle, "MYADDR", LINKDOWNFILE, NULL, NULL);
+ } else
+ system_Select(fp->bundle, "MYADDR", LINKDOWNFILE, NULL, NULL);
+ }
- ipcp_Setup(ipcp, INADDR_NONE);
+ ipcp_Setup(ipcp, INADDR_NONE);
+ }
+ recursing--;
}
int
OpenPOWER on IntegriCloud