Skip to contentSkip to conversation

ppp: Apply configuration options from a DCE request if ACK it

PATCH In review [email protected] 2 participants 2 messages Jan 1, 2021 – Jan 4, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppp: Apply configuration options from a DCE request if ACK it

From: Sergei Golubtsov <[email protected]>

Apply configuration options if the DCE sends a PPP LCP configure request and the DTE is going to ACK the request. Otherwise some options such as the ACCM may not correspond to the configuration negotiated with the DCE.

---
 gatchat/ppp_cp.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
gatchat/ppp_cp.c +5 -2
index f3f2cc4f..371055e4 100644
@@ -660,9 +660,12 @@ static void pppcp_generate_event(struct pppcp_data *data,
 	if (actions & SCR)
 		pppcp_send_configure_request(data);
 
-	if (actions & SCA)
+	if (actions & SCA) {
+		/* Apply local options */
+		if (data->driver->rca)
+			data->driver->rca(data, packet);
 		pppcp_send_configure_ack(data, packet);
-	else if (actions & SCN)
+	} else if (actions & SCN)
 		pppcp_send_configure_nak(data, packet);
 
 	if (actions & STR)
Signature · 1 line
2.17.1
#1 lore raw

Hi Sergei,

Quoted 15 lines · s.e.golubtsov(a)gmail.com

From: Sergei Golubtsov <[email protected]>

Apply configuration options if the DCE sends a PPP LCP configure request and the DTE is going to ACK the request. Otherwise some options such as the ACCM may not correspond to the configuration negotiated with the DCE.

---
  gatchat/ppp_cp.c | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)
gatchat/ppp_cp.c +0 -0
index f3f2cc4f..371055e4 100644

gatchat/ppp_cp.c static void pppcp_generate_event(struct pppcp_data *data, · line 666

Quoted 8 lines
gatchat/ppp_cp.c +4 -1
@@ -660,9 +660,12 @@ static void pppcp_generate_event(struct pppcp_data *data,
  	if (actions & SCR)
  		pppcp_send_configure_request(data);
 
-	if (actions & SCA)
+	if (actions & SCA) {
+		/* Apply local options */
+		if (data->driver->rca)
+			data->driver->rca(data, packet);

So this is incorrect. You're applying options of the wrong 'side'. See my reply in the other thread for a more detailed explanation.

gatchat/ppp_cp.c static void pppcp_generate_event(struct pppcp_data *data, · line 671

Quoted 7 lines
gatchat/ppp_cp.c +1 -1
  		pppcp_send_configure_ack(data, packet);
-	else if (actions & SCN)
+	} else if (actions & SCN)
  		pppcp_send_configure_nak(data, packet);
 
  	if (actions & STR)

Regards,
-Denis