Correctly (if inelegantly) handle interfaces named 'inet'

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@3514 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2006-02-21 16:46:21 +00:00
parent 19b0fd864e
commit ce34cc4f35
4 changed files with 6 additions and 3 deletions

View File

@ -87,3 +87,5 @@ Changes in 3.1.x.
3.1.7
38) Remove compile-time running of extension scripts.
39) Correctly handle interfaces named 'inet'.

View File

@ -1042,7 +1042,7 @@ validate_interfaces_file() {
;;
norfc1918)
cat >&3 << __EOF__
${INDENT}addr=\$(ip -f inet addr show $interface 2> /dev/null | grep inet | head -n1)
${INDENT}addr=\$(ip -f inet addr show $interface 2> /dev/null | grep 'inet\ ' | head -n1)
${INDENT}if [ -n "\$addr" ]; then
${INDENT} addr=\$(echo \$addr | sed 's/inet //;s/\/.*//;s/ peer.*//')
${INDENT} for network in 10.0.0.0/8 176.16.0.0/12 192.168.0.0/16; do

View File

@ -1067,7 +1067,7 @@ find_first_interface_address() # $1 = interface
#
find_interface_addresses() # $1 = interface
{
ip -f inet addr show $1 | grep inet | sed 's/inet //;s/\/.*//;s/ peer.*//'
ip -f inet addr show $1 | grep inet\ | sed 's/inet //;s/\/.*//;s/ peer.*//'
}
#

View File

@ -29,7 +29,8 @@ Note to users upgrading from Shorewall 2.x or 3.0
Problems Corrected in 3.1.8
None.
1) Previously, startup errors occurred if the user had configured a network
interface named 'inet'.
Other changes in 3.1.8