mirror of git://git.sysmocom.de/ofono
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.
This commit is contained in:
parent
557f4cdb16
commit
28b2c32dc7
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue