Page 1 of 1

iptables "Bad Argument" in firewall util

Posted: Sun Feb 07, 2010 9:17 am
by Hannibal
Hi,

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'
solve this issue.

/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
}

Re: iptables "Bad Argument" in firewall util

Posted: Mon Feb 08, 2010 12:04 am
by Eric
You patch has been applied to the SVN in r742, and will be included in the next release. Thanks!

Two things:
1) Next time please send me a link (or email me) a diff. Run:

Code: Select all

diff -u [old file] [new file]
This should give you a list of exactly what has changed in the file.

2) If you're interested in commit access, this counts as the first of your three patches necessary.