subnet4_to_prefixlen() should use ntohl().

This commit is contained in:
Nicholas J. Kain 2014-03-14 23:22:23 -04:00
parent b6444fa806
commit 3af0a7824d

View File

@ -103,7 +103,7 @@ static int trailz(uint32_t v)
// sn must be in network order
static inline int subnet4_to_prefixlen(uint32_t sn)
{
return 32 - trailz(sn);
return 32 - trailz(ntohl(sn));
}
// str_bcast is optional.