diff options
author | ume <ume@FreeBSD.org> | 2003-03-25 15:59:27 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2003-03-25 15:59:27 +0000 |
commit | f92a704df5ac95408d63dc8819ef62397b52a960 (patch) | |
tree | 5fbd000726c6facb5d0291a4222e6f68a4028f2c /usr.sbin/ppp/ipv6cp.c | |
parent | 0501a6a0fa9d6852df5fb0e8dbefea63f40a66d8 (diff) | |
download | FreeBSD-src-f92a704df5ac95408d63dc8819ef62397b52a960.zip FreeBSD-src-f92a704df5ac95408d63dc8819ef62397b52a960.tar.gz |
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.
Diffstat (limited to 'usr.sbin/ppp/ipv6cp.c')
-rw-r--r-- | usr.sbin/ppp/ipv6cp.c | 34 |
1 files changed, 32 insertions, 2 deletions
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); } |