Merge pull request #222 from danimo/fix_subnet_calc

mkinitrd-suse.sh: Fix prefix calculation
master
Harald Hoyer 2017-04-26 09:22:19 +02:00 committed by GitHub
commit bc6f06a795
1 changed files with 1 additions and 1 deletions

View File

@ -104,7 +104,7 @@ calc_netmask() {
local prefix=$1

[ -z "$prefix" ] && return
mask=$(echo "(2 ^ 32) - (2 ^ $prefix)" | bc -l)
mask=$(( 0xffffffff << (32 - $prefix) ))
byte1=$(( mask >> 24 ))
byte2=$(( mask >> 16 ))
byte3=$(( mask >> 8 ))