From 3af0a7824db50bd0aaf1320dbb7358ad7a05d468 Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Fri, 14 Mar 2014 23:22:23 -0400 Subject: [PATCH] subnet4_to_prefixlen() should use ntohl(). --- ndhc/ifset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.