ead: message handling fixes

SVN-Revision: 13828
This commit is contained in:
Felix Fietkau
2009-01-02 23:51:57 +00:00
parent c7ff578b9f
commit d9397119c5
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);