summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Fedoryshchenko <denys.f@collabora.com>2026-07-19 00:55:50 +0300
committerGitHub <noreply@github.com>2026-07-19 00:55:50 +0300
commit779c2d0233559bac9e00e1f62d10c13218f90bee (patch)
treee6ea4eec63c0accef5499464e2f36848960e63f9
parent214be6067128e5c1982c0b4ab1a950c287b05e3e (diff)
parenta9dd25763194f0df41f2a0c2b135f5c872886ae4 (diff)
downloadaccel-ppp-779c2d0233559bac9e00e1f62d10c13218f90bee.tar.gz
accel-ppp-779c2d0233559bac9e00e1f62d10c13218f90bee.zip
Merge pull request #330 from nuclearcat/ipv6cp-term-fix
ppp: don't terminate session on IPV6CP TermReq unless IPv6 is required
-rw-r--r--accel-pppd/ppp/ppp_ipv6cp.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/accel-pppd/ppp/ppp_ipv6cp.c b/accel-pppd/ppp/ppp_ipv6cp.c
index 1194b314..7f278daa 100644
--- a/accel-pppd/ppp/ppp_ipv6cp.c
+++ b/accel-pppd/ppp/ppp_ipv6cp.c
@@ -205,8 +205,12 @@ static void ipv6cp_layer_finished(struct ppp_fsm_t *fsm)
ap_session_terminate(&ipv6cp->ppp->ses, TERM_USER_ERROR, 0);
else
ppp_layer_passive(ipv6cp->ppp, &ipv6cp->ld);
- } else if (!ipv6cp->ppp->ses.terminating)
- ap_session_terminate(&ipv6cp->ppp->ses, TERM_USER_ERROR, 0);
+ } else if (!ipv6cp->ppp->ses.terminating) {
+ if (conf_ipv6 == IPV6_REQUIRE)
+ ap_session_terminate(&ipv6cp->ppp->ses, TERM_USER_ERROR, 0);
+ else
+ log_ppp_info1("ipv6cp: closed, session continues without IPv6\n");
+ }
fsm->fsm_state = FSM_Closed;
}
@@ -738,7 +742,12 @@ static void ipv6cp_recv(struct ppp_handler_t*h)
if (conf_ppp_verbose)
log_ppp_info2("recv [IPV6CP TermReq id=%x]\n", hdr->id);
ppp_fsm_recv_term_req(&ipv6cp->fsm);
- ap_session_terminate(&ipv6cp->ppp->ses, TERM_USER_REQUEST, 0);
+ /* RFC 1661 sec 3.7: closing one NCP is not sufficient reason
+ * to terminate the PPP link */
+ if (conf_ipv6 == IPV6_REQUIRE)
+ ap_session_terminate(&ipv6cp->ppp->ses, TERM_USER_REQUEST, 0);
+ else
+ ppp_layer_passive(ipv6cp->ppp, &ipv6cp->ld);
break;
case TERMACK:
if (conf_ppp_verbose)