summaryrefslogtreecommitdiffstats
path: root/gatchat/ppp_ipcp.c
diff options
context:
space:
mode:
authorZhenhua Zhang <zhenhua.zhang@intel.com>2010-06-23 17:46:37 +0800
committerDenis Kenzior <denkenz@gmail.com>2010-06-23 16:45:28 -0500
commit28b2c32dc7bb5eb9fe24eba40548afdfa9bffb54 (patch)
treecc76b3443ab6852c60c543b3932765bccfe6580a /gatchat/ppp_ipcp.c
parent557f4cdb16b57927efd2a1eacc0379980ec3fd66 (diff)
downloadofono-28b2c32dc7bb5eb9fe24eba40548afdfa9bffb54.tar.bz2
ppp: Fix incorrect packet length for little-endian
packet->length is in TCP/IP network byte order. It needs to call ntohs() to convert to host byte order, which is little-endian.
Diffstat (limited to 'gatchat/ppp_ipcp.c')
-rw-r--r--gatchat/ppp_ipcp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gatchat/ppp_ipcp.c b/gatchat/ppp_ipcp.c
index a1eacdfc..0b3c3817 100644
--- a/gatchat/ppp_ipcp.c
+++ b/gatchat/ppp_ipcp.c
@@ -281,7 +281,7 @@ static enum rcr_result ipcp_rcr(struct pppcp_data *pppcp,
return RCR_ACCEPT;
/* Reject all options */
- *new_len = packet->length - sizeof(*packet);
+ *new_len = ntohs(packet->length) - sizeof(*packet);
*new_options = g_memdup(packet->data, *new_len);
return RCR_REJECT;