iptables "Bad Argument" in firewall util

If your problem doesn't fall into one of the other categories, report it here.

Moderator: Moderators

Post Reply
Hannibal
Posts: 10
Joined: Fri Jun 05, 2009 4:09 pm

iptables "Bad Argument" in firewall util

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

Eric
Site Admin
Posts: 1443
Joined: Sat Jun 14, 2008 1:14 pm

Re: iptables "Bad Argument" in firewall util

Post 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.

Post Reply