1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-07-02 19:43:16 +03:00

ead: message handling fixes

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13828 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2009-01-02 23:51:57 +00:00
parent 8db97c0089
commit 7619ddb0a2
2 changed files with 5 additions and 2 deletions

View File

@ -143,7 +143,10 @@ static bool
handle_pong(void)
{
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;
auth_type = ntohs(pong->auth_type);

View File

@ -330,7 +330,7 @@ handle_ping(struct ead_packet *pkt, int len, int *nstate)
msg->len = htonl(sizeof(struct ead_msg_pong) + slen);
strncpy(pong->name, dev_name, slen);
pong->name[len] = 0;
pong->name[slen] = 0;
pong->auth_type = htons(EAD_AUTH_MD5);
return true;