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:
Zhenhua Zhang 2010-06-23 17:46:37 +08:00 committed by Denis Kenzior
parent 557f4cdb16
commit 28b2c32dc7
1 changed files with 1 additions and 1 deletions

View File

@ -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;