From f92a704df5ac95408d63dc8819ef62397b52a960 Mon Sep 17 00:00:00 2001 From: ume Date: Tue, 25 Mar 2003 15:59:27 +0000 Subject: Since ppp.link{up,down} is invoked at the end of IPCP negotiation, if we need ppp.link{up,down}, we couldn't disable IPCP. Now, if IPCP is disabled, ppp.link{up,down} is invoked at the end of IPV6CP negotiation. --- usr.sbin/ppp/ipv6cp.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'usr.sbin/ppp') diff --git a/usr.sbin/ppp/ipv6cp.c b/usr.sbin/ppp/ipv6cp.c index bdc9e0f..d89595e 100644 --- a/usr.sbin/ppp/ipv6cp.c +++ b/usr.sbin/ppp/ipv6cp.c @@ -460,7 +460,22 @@ ipv6cp_LayerUp(struct fsm *fp) log_Printf(LogIPV6CP, "myaddr %s hisaddr = %s\n", tbuff, ncpaddr_ntoa(&ipv6cp->hisaddr)); - /* XXX: Call radius_Account() and system_Select() */ + /* XXX: Call radius_Account() */ + + if (!Enabled(fp->bundle, OPT_IPCP)) { + /* + * XXX this stuff should really live in the FSM. Our config should + * associate executable sections in files with events. + */ + if (system_Select(fp->bundle, tbuff, LINKUPFILE, NULL, NULL) < 0) { + if (bundle_GetLabel(fp->bundle)) { + if (system_Select(fp->bundle, bundle_GetLabel(fp->bundle), + LINKUPFILE, NULL, NULL) < 0) + system_Select(fp->bundle, "MYADDR6", LINKUPFILE, NULL, NULL); + } else + system_Select(fp->bundle, "MYADDR6", LINKUPFILE, NULL, NULL); + } + } fp->more.reqs = fp->more.naks = fp->more.rejs = ipv6cp->cfg.fsm.maxreq * 3; log_DisplayPrompts(); @@ -480,7 +495,22 @@ ipv6cp_LayerDown(struct fsm *fp) snprintf(addr, sizeof addr, "%s", ncpaddr_ntoa(&ipv6cp->myaddr)); log_Printf(LogIPV6CP, "%s: LayerDown: %s\n", fp->link->name, addr); - /* XXX: Call radius_Account() and system_Select() */ + /* XXX: Call radius_Account() */ + + if (!Enabled(fp->bundle, OPT_IPCP)) { + /* + * XXX this stuff should really live in the FSM. Our config should + * associate executable sections in files with events. + */ + if (system_Select(fp->bundle, addr, 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, "MYADDR6", LINKDOWNFILE, NULL, NULL); + } else + system_Select(fp->bundle, "MYADDR6", LINKDOWNFILE, NULL, NULL); + } + } ipv6cp_Setup(ipv6cp); } -- cgit v1.1