From f1ae8963c9251c23752e932eede36bf6f8901dbf Mon Sep 17 00:00:00 2001 From: Yuta SATOH Date: Fri, 8 Mar 2013 15:16:21 -0600 Subject: oldnet: convert netmask to decimal numbers in _netmask2cidr Free BSD's ifconfig outputs a netmask in the form 0xffffff00, which was translating to 0xff.0xff.0xff.0x00,. Now we convert this to decimal numbers before we convert it to cidr notation. Reported-by: 4glitch@gmail.com X-Gentoo-Bug: 460268 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=460268 --- init.d/net.lo.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.d/net.lo.in b/init.d/net.lo.in index 95744f8..cc3bfd0 100644 --- a/init.d/net.lo.in +++ b/init.d/net.lo.in @@ -151,6 +151,9 @@ _netmask2cidr() local i= len= local IFS=. for i in $1; do + case $i in + 0x*) i=$((i)) ;; + esac while [ ${i} -ne 0 ]; do : $(( len += i % 2 )) : $(( i >>= 1 )) -- cgit v1.2.3