From: Marco d'Itri Date: Wed, 25 Jan 2012 19:14:26 +0100 Subject: [PATCH] git-20100307 --- pppd/lcp.c | 28 +++++++++++++++++++--------- pppd/plugins/pppol2tp/Makefile.linux | 2 +- pppd/plugins/rp-pppoe/plugin.c | 4 ++-- pppd/pppd.8 | 8 ++++++++ 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/pppd/lcp.c b/pppd/lcp.c index 5c77490..8ed2778 100644 --- a/pppd/lcp.c +++ b/pppd/lcp.c @@ -397,21 +397,29 @@ lcp_close(unit, reason) char *reason; { fsm *f = &lcp_fsm[unit]; + int oldstate; if (phase != PHASE_DEAD && phase != PHASE_MASTER) new_phase(PHASE_TERMINATE); - if (f->state == STOPPED && f->flags & (OPT_PASSIVE|OPT_SILENT)) { + + if (f->flags & DELAYED_UP) { + untimeout(lcp_delayed_up, f); + f->state = STOPPED; + } + oldstate = f->state; + + fsm_close(f, reason); + if (oldstate == STOPPED && f->flags & (OPT_PASSIVE|OPT_SILENT|DELAYED_UP)) { /* * This action is not strictly according to the FSM in RFC1548, * but it does mean that the program terminates if you do a - * lcp_close() in passive/silent mode when a connection hasn't - * been established. + * lcp_close() when a connection hasn't been established + * because we are in passive/silent mode or because we have + * delayed the fsm_lowerup() call and it hasn't happened yet. */ - f->state = CLOSED; + f->flags &= ~DELAYED_UP; lcp_finished(f); - - } else - fsm_close(f, reason); + } } @@ -453,9 +461,10 @@ lcp_lowerdown(unit) { fsm *f = &lcp_fsm[unit]; - if (f->flags & DELAYED_UP) + if (f->flags & DELAYED_UP) { f->flags &= ~DELAYED_UP; - else + untimeout(lcp_delayed_up, f); + } else fsm_lowerdown(&lcp_fsm[unit]); } @@ -489,6 +498,7 @@ lcp_input(unit, p, len) if (f->flags & DELAYED_UP) { f->flags &= ~DELAYED_UP; + untimeout(lcp_delayed_up, f); fsm_lowerup(f); } fsm_input(f, p, len); diff --git a/pppd/plugins/pppol2tp/Makefile.linux b/pppd/plugins/pppol2tp/Makefile.linux index 19eff67..ea3538e 100644 --- a/pppd/plugins/pppol2tp/Makefile.linux +++ b/pppd/plugins/pppol2tp/Makefile.linux @@ -20,7 +20,7 @@ all: $(PLUGINS) install: all $(INSTALL) -d -m 755 $(LIBDIR) - $(INSTALL) -c -m 4550 $(PLUGINS) $(LIBDIR) + $(INSTALL) -c -m 755 $(PLUGINS) $(LIBDIR) clean: rm -f *.o *.so diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c index e94494b..9bd6643 100644 --- a/pppd/plugins/rp-pppoe/plugin.c +++ b/pppd/plugins/rp-pppoe/plugin.c @@ -108,8 +108,6 @@ PPPOEInitDevice(void) novm("PPPoE session data"); } memset(conn, 0, sizeof(PPPoEConnection)); - conn->acName = acName; - conn->serviceName = pppd_pppoe_service; conn->ifName = devnam; conn->discoverySocket = -1; conn->sessionSocket = -1; @@ -133,6 +131,8 @@ PPPOEConnectDevice(void) { struct sockaddr_pppox sp; + conn->acName = acName; + conn->serviceName = pppd_pppoe_service; strlcpy(ppp_devnam, devnam, sizeof(ppp_devnam)); if (existingSession) { unsigned int mac[ETH_ALEN]; diff --git a/pppd/pppd.8 b/pppd/pppd.8 index 8ea8200..b7adc77 100644 --- a/pppd/pppd.8 +++ b/pppd/pppd.8 @@ -193,6 +193,9 @@ will not accept a different value from the peer in the IPCP negotiation, unless the \fIipcp\-accept\-local\fR and/or \fIipcp\-accept\-remote\fR options are given, respectively. .TP +.B +ipv6 +Enable the IPv6CP and IPv6 protocols. +.TP .B ipv6 \fI\fR,\fI Set the local and/or remote 64-bit interface identifier. Either one may be omitted. The identifier must be specified in standard ascii notation of @@ -449,6 +452,11 @@ scripts. If this option is given, the \fIstring\fR supplied is given as the 6th parameter to those scripts. .TP +.B ipv6cp\-accept\-local +With this option, pppd will accept the peer's idea of our local IPv6 +interface identifier, even if the local IPv6 interface identifier +was specified in an option. +.TP .B ipv6cp\-max\-configure \fIn Set the maximum number of IPv6CP configure-request transmissions to \fIn\fR (default 10).