mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-21 10:18:58 +02: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:
parent
0f61f36264
commit
61ba5353e5
@ -20,3 +20,5 @@ Changes since 1.4.6
|
|||||||
9) Added generic tunnel support.
|
9) Added generic tunnel support.
|
||||||
|
|
||||||
10) Added support for Address Range Lists in /etc/shorewall/masq.
|
10) Added support for Address Range Lists in /etc/shorewall/masq.
|
||||||
|
|
||||||
|
11) Simplify ip_broadcast()
|
||||||
|
@ -331,12 +331,11 @@ ip_network() {
|
|||||||
# The following hack is supplied to compensate for the fact that many of
|
# The following hack is supplied to compensate for the fact that many of
|
||||||
# the popular light-weight Bourne shell derivatives don't support XOR ("^").
|
# the popular light-weight Bourne shell derivatives don't support XOR ("^").
|
||||||
#
|
#
|
||||||
# Note: 2147483647 = 0x7fffffff
|
|
||||||
|
|
||||||
ip_broadcast() {
|
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 ))
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user