mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-10 11:09:57 +08:00
ead: message handling fixes
SVN-Revision: 13828
This commit is contained in:
parent
c7ff578b9f
commit
d9397119c5
@ -143,7 +143,10 @@ static bool
|
|||||||
handle_pong(void)
|
handle_pong(void)
|
||||||
{
|
{
|
||||||
struct ead_msg_pong *pong = EAD_DATA(msg, pong);
|
struct ead_msg_pong *pong = EAD_DATA(msg, pong);
|
||||||
int len = msg->len - sizeof(struct ead_msg_pong);
|
int len = ntohl(msg->len) - sizeof(struct ead_msg_pong);
|
||||||
|
|
||||||
|
if (len <= 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
pong->name[len] = 0;
|
pong->name[len] = 0;
|
||||||
auth_type = ntohs(pong->auth_type);
|
auth_type = ntohs(pong->auth_type);
|
||||||
|
@ -330,7 +330,7 @@ handle_ping(struct ead_packet *pkt, int len, int *nstate)
|
|||||||
|
|
||||||
msg->len = htonl(sizeof(struct ead_msg_pong) + slen);
|
msg->len = htonl(sizeof(struct ead_msg_pong) + slen);
|
||||||
strncpy(pong->name, dev_name, slen);
|
strncpy(pong->name, dev_name, slen);
|
||||||
pong->name[len] = 0;
|
pong->name[slen] = 0;
|
||||||
pong->auth_type = htons(EAD_AUTH_MD5);
|
pong->auth_type = htons(EAD_AUTH_MD5);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user