Allow 'optional' to work with 'maclist'

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6076 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-04-23 14:14:46 +00:00
parent b560dbd418
commit 3a50a8a1be
3 changed files with 11 additions and 3 deletions

View File

@ -751,7 +751,7 @@ find_interface_by_mac() {
# Determine if Interface is up # Determine if Interface is up
# #
interface_is_up() { interface_is_up() {
[ -n "$(ip link ls dev $1 | grep -e '[<,]UP[,>]')" ] [ -n "$(ip link ls dev $1 2> /dev/null | grep -e '[<,]UP[,>]')" ]
} }
# #

View File

@ -759,8 +759,12 @@ sub setup_mac_lists( $ ) {
add_command $chainref, " echo \"-A $chainref->{name} -s \$address -d 255.255.255.255 -j RETURN\" >&3"; add_command $chainref, " echo \"-A $chainref->{name} -s \$address -d 255.255.255.255 -j RETURN\" >&3";
add_command $chainref, " echo \"-A $chainref->{name} -s \$address -d 224.0.0.0/4 -j RETURN\" >&3"; add_command $chainref, " echo \"-A $chainref->{name} -s \$address -d 224.0.0.0/4 -j RETURN\" >&3";
add_command $chainref, ' done'; add_command $chainref, ' done';
unless ( interface_is_optional $interface ) {
add_command $chainref, 'else'; add_command $chainref, 'else';
add_command $chainref, " fatal_error \"Interface $interface must be up before Shorewall can start\""; add_command $chainref, " fatal_error \"Interface $interface must be up before Shorewall can start\"";
}
add_command $chainref, "fi\n"; add_command $chainref, "fi\n";
} }

View File

@ -3780,7 +3780,11 @@ __EOF__
done done
if [ "$LOG_MARTIANS" = yes ]; then if [ "$LOG_MARTIANS" = yes ]; then
save_command "echo 1 > /proc/sys/net/ipv4/conf/all/log_martians"
save_command "echo 1 > /proc/sys/net/ipv4/conf/default/log_martians" save_command "echo 1 > /proc/sys/net/ipv4/conf/default/log_martians"
else
save_command "echo 0 > /proc/sys/net/ipv4/conf/all/log_martians"
save_command "echo 0 > /proc/sys/net/ipv4/conf/default/log_martians"
fi fi
fi fi