1
0
mirror of https://gitlab.com/shorewall/code.git synced 2025-01-11 16:18:13 +01:00

Simplify ip_broadcast()

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@689 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2003-08-07 17:31:47 +00:00
parent 0f61f36264
commit 61ba5353e5
2 changed files with 4 additions and 3 deletions

View File

@ -20,3 +20,5 @@ Changes since 1.4.6
9) Added generic tunnel support.
10) Added support for Address Range Lists in /etc/shorewall/masq.
11) Simplify ip_broadcast()

View File

@ -331,12 +331,11 @@ ip_network() {
# The following hack is supplied to compensate for the fact that many of
# the popular light-weight Bourne shell derivatives don't support XOR ("^").
#
# Note: 2147483647 = 0x7fffffff
ip_broadcast() {
local x=$(( ${1#*/} - 1 ))
local x=$(( 32 - ${1#*/} ))
[ $x -eq -1 ] && echo -1 || echo $(( 2147483647 >> $x ))
[ $x -eq 0 ] && echo -1 || echo $(( $(( 1 $LEFTSHIFT $x )) - 1 ))
}
#