stun: fix endian conversion in stun_attr_decode

This commit is contained in:
Richard Aas 2013-07-29 08:49:24 +00:00
parent 3f74483464
commit bef73ecc4a

View file

@ -192,8 +192,8 @@ int stun_attr_decode(struct stun_attr **attrp, struct mbuf *mb,
if (!attr)
return ENOMEM;
attr->type = htons(mbuf_read_u16(mb));
len = htons(mbuf_read_u16(mb));
attr->type = ntohs(mbuf_read_u16(mb));
len = ntohs(mbuf_read_u16(mb));
if (mbuf_get_left(mb) < len)
goto badmsg;