iptables "Bad Argument" in firewall util
Posted: Sun Feb 07, 2010 9:17 am
Hi,
i've edited the /etc/ethers manually and got some errors when initializing the firewall.
This happens because of not filtering empty lines...
addingsolve this issue.
/usr/lib/gargoyle_firewall_util/gargoyle_firewall_util.sh
LINE: 316
before:
after:
i've edited the /etc/ethers manually and got some errors when initializing the firewall.
This happens because of not filtering empty lines...
adding
Code: Select all
sed '/^[ \t]*$/d'
/usr/lib/gargoyle_firewall_util/gargoyle_firewall_util.sh
LINE: 316
before:
Code: Select all
block_static_ip_mismatches()
{
block_mismatches=$(uci get firewall.@defaults[0].block_static_ip_mismatches 2> /dev/null)
if [ "$block_mismatches" = "1" ] && [ -e /etc/ethers ] ; then
eval $(cat /etc/ethers | awk ' { print "iptables -t filter -I forward -s ! " $2 " -m mac --mac-source " $1 " -j REJECT " ; } ' )
fi
}
after:
Code: Select all
block_static_ip_mismatches()
{
block_mismatches=$(uci get firewall.@defaults[0].block_static_ip_mismatches 2> /dev/null)
if [ "$block_mismatches" = "1" ] && [ -e /etc/ethers ] ; then
eval $(cat /etc/ethers | sed '/^[ \t]*$/d' | awk ' { print "iptables -t filter -I forward -s ! " $2 " -m mac --mac-source " $1 " -j REJECT " ; } ' )
fi
}