PPP: Fix Transmit ACCM and Receive ACCM setting error
PATCH 1/2 PPP: Fix Transmit ACCM and Receive ACCM setting error
From: Martin Xu <[email protected]>
--- gatchat/ppp_lcp.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-)
gatchat/ppp_lcp.c +11 -2
@@ -149,7 +149,11 @@ static void lcp_rca(struct pppcp_data *pppcp, const struct pppcp_packet *packet)while (ppp_option_iter_next (&iter) == TRUE) {switch (ppp_option_iter_get_type (&iter)) {case ACCM : -ppp_set_xmit_accm (pppcp_get_ppp (pppcp),0 ); +/* RFC1662 Section 7.1 +* The Configuration Option is used to inform the peer which control +* characters MUST remain mapped when the peer sends them. +*/ +ppp_set_recv_accm (pppcp_get_ppp (pppcp),0 );break ;default :break ;
@@ -263,7 +267,12 @@ static enum rcr_result lcp_rcr(struct pppcp_data *pppcp,while (ppp_option_iter_next (&iter) == TRUE) {switch (ppp_option_iter_get_type (&iter)) {case ACCM : -ppp_set_recv_accm (ppp, +/* RFC1662 Section 7.1 +* The Configuration Option is used to inform the peer which control +* characters MUST remain mapped when the peer sends them. +*/ + +ppp_set_xmit_accm (ppp,get_host_long (ppp_option_iter_get_data (&iter)));break ;case AUTH_PROTO :
Signature · 1 line
1.7.2.2
Hi Martin,
Quoted 5 lines · martin.xu(a)intel.com
From: Martin Xu <[email protected]>
--- gatchat/ppp_lcp.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-)
Can you write a better description of this patch? The subject is not enough...
Quoted 6 lines
gatchat/ppp_lcp.c +0
-0
gatchat/ppp_lcp.c static void lcp_rca(struct pppcp_data *pppcp, const struct pppcp_packet *packet) · line 157
Quoted 10 lines
gatchat/ppp_lcp.c +5
-1@@ -149,7 +149,11 @@ static void lcp_rca(struct pppcp_data *pppcp, const struct pppcp_packet *packet)while (ppp_option_iter_next (&iter) == TRUE) {switch (ppp_option_iter_get_type (&iter)) {case ACCM : -ppp_set_xmit_accm (pppcp_get_ppp (pppcp),0 ); +/* RFC1662 Section 7.1 +* The Configuration Option is used to inform the peer which control +* characters MUST remain mapped when the peer sends them. +*/ +ppp_set_recv_accm (pppcp_get_ppp (pppcp),0 );break ;
Hah, so I actually managed to mix up the xmit and recv accms :P
Can you please align the comment with the code and follow item M2 from doc/coding-style.txt?
Currently we always request 0 as the peer's xmit ACCM, so the present code should work either way. However, it might be safer to use the recv ACCM that was eventually accepted by the peer. This would also make chunk 2 of patch 2 unnecessary.
gatchat/ppp_lcp.c static enum rcr_result lcp_rcr(struct pppcp_data *pppcp, · line 273
Quoted 11 lines
gatchat/ppp_lcp.c +4
-1default :break ;@@ -263,7 +267,12 @@ static enum rcr_result lcp_rcr(struct pppcp_data *pppcp,while (ppp_option_iter_next (&iter) == TRUE) {switch (ppp_option_iter_get_type (&iter)) {case ACCM : - ppp_set_recv_accm(ppp, +/* RFC1662 Section 7.1 +* The Configuration Option is used to inform the peer which control +* characters MUST remain mapped when the peer sends them. +*/
Same comment as above about the comment formatting
gatchat/ppp_lcp.c static enum rcr_result lcp_rcr(struct pppcp_data *pppcp, · line 274
Quoted 1 line
gatchat/ppp_lcp.c +1
-0+
Please remove this empty line
gatchat/ppp_lcp.c static enum rcr_result lcp_rcr(struct pppcp_data *pppcp, · line 278
Quoted 4 lines
gatchat/ppp_lcp.c +1
-0+ppp_set_xmit_accm (ppp,get_host_long (ppp_option_iter_get_data (&iter)));break ;case AUTH_PROTO :
Regards,
-Denis