diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2005-09-19 19:31:47 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2005-09-19 19:31:47 +0000 |
commit | 54e5585503d70e94172dc4312cbbbdecca806486 (patch) | |
tree | 871d1b611265e534472dc824cab2887b5b4a3332 /usr.sbin | |
parent | add2bba0f2a206ffbc201c7992ccdef4fd1ecbc3 (diff) |
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
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/ppp/ipv6cp.c | 32 |
1 files changed, 29 insertions, 3 deletions
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 <sys/param.h> @@ -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); } |