From 54e5585503d70e94172dc4312cbbbdecca806486 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Mon, 19 Sep 2005 19:31:47 +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. From FreeBSD --- usr.sbin/ppp/ppp/ipv6cp.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/ppp/ppp/ipv6cp.c b/usr.sbin/ppp/ppp/ipv6cp.c index 274a01f38d9..4998c8d3b12 100644 --- a/usr.sbin/ppp/ppp/ipv6cp.c +++ b/usr.sbin/ppp/ppp/ipv6cp.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: ipv6cp.c,v 1.5 2005/09/19 18:55:32 brad Exp $ + * $OpenBSD: ipv6cp.c,v 1.6 2005/09/19 19:31:46 brad Exp $ */ #include @@ -472,7 +472,20 @@ 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() */ + + /* + * 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) && !Enabled(fp->bundle, OPT_IPCP)) { + 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(); @@ -492,7 +505,20 @@ 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() */ + + /* + * 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) && !Enabled(fp->bundle, OPT_IPCP)) { + 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.2.3