projects
/
platform
/
upstream
/
ofono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
557f4cd
)
ppp: Fix incorrect packet length for little-endian
author
Zhenhua Zhang
<zhenhua.zhang@intel.com>
Wed, 23 Jun 2010 09:46:37 +0000
(17:46 +0800)
committer
Denis Kenzior
<denkenz@gmail.com>
Wed, 23 Jun 2010 21:45:28 +0000
(16:45 -0500)
packet->length is in TCP/IP network byte order. It needs to call ntohs()
to convert to host byte order, which is little-endian.
gatchat/ppp_ipcp.c
patch
|
blob
|
history
diff --git
a/gatchat/ppp_ipcp.c
b/gatchat/ppp_ipcp.c
index
a1eacdf
..
0b3c381
100644
(file)
--- 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;