All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] PPP: Fix Transmit ACCM and Receive ACCM setting error
@ 2011-01-10 10:40 martin.xu
  2011-01-11 17:06 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: martin.xu @ 2011-01-10 10:40 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1318 bytes --]

From: Martin Xu <martin.xu@intel.com>

---
 gatchat/ppp_lcp.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/gatchat/ppp_lcp.c b/gatchat/ppp_lcp.c
index 3a80a62..bc97257 100644
--- a/gatchat/ppp_lcp.c
+++ b/gatchat/ppp_lcp.c
@@ -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:
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/2] PPP: Fix Transmit ACCM and Receive ACCM setting error
  2011-01-10 10:40 [PATCH 1/2] PPP: Fix Transmit ACCM and Receive ACCM setting error martin.xu
@ 2011-01-11 17:06 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2011-01-11 17:06 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2057 bytes --]

Hi Martin,

On 01/10/2011 04:40 AM, martin.xu(a)intel.com wrote:
> From: Martin Xu <martin.xu@intel.com>
> 
> ---
>  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...

> 
> diff --git a/gatchat/ppp_lcp.c b/gatchat/ppp_lcp.c
> index 3a80a62..bc97257 100644
> --- a/gatchat/ppp_lcp.c
> +++ b/gatchat/ppp_lcp.c
> @@ -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.

>  		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.
> +		 */

Same comment as above about the comment formatting

> +

Please remove this empty line

> +			ppp_set_xmit_accm(ppp,
>  				get_host_long(ppp_option_iter_get_data(&iter)));
>  			break;
>  		case AUTH_PROTO:

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-11 17:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-10 10:40 [PATCH 1/2] PPP: Fix Transmit ACCM and Receive ACCM setting error martin.xu
2011-01-11 17:06 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.