diff --git a/ndhc/ifset.c b/ndhc/ifset.c index 84336c0..3faf9b6 100644 --- a/ndhc/ifset.c +++ b/ndhc/ifset.c @@ -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.