Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 10736 - iptables-save doesn't work with MAC
Summary: iptables-save doesn't work with MAC
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Daniel Ahlberg (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-14 07:36 UTC by fbusse
Modified: 2003-02-04 19:42 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for iptables-save (iptables.diff,690 bytes, patch)
2002-11-14 07:37 UTC, fbusse
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description fbusse 2002-11-14 07:36:21 UTC
"iptables-restore" doesn't work if "iptables-save" saved a rule with "-m mac
--mac-source"
To reproduce this:

Create a rule:
iptables -A INPUT -i eth0 -m mac --mac-source ! 00:01:02:03:04:05 -j REJECT

Save this rule
iptables-save > test.iptables

Load the ruleset
iptables-restore test.iptables
iptables-restore v1.2.7a: Bad mac address `!00:01:02:03:04:05'
Try `iptables-restore -h' or 'iptables-restore --help' for more

iptables-save doesn't add a space before it prints the mac-address, it looks
like this:
-A INPUT -i wlan0 -m mac --mac !00:02:2D:5C:08:1B -j DROP

instead of:
-A INPUT -i wlan0 -m mac --mac ! 00:02:2D:5C:08:1B -j DROP

This problem is known since at least April 2002, but hasn't been fixed yet by
the netfilter team, although the patch is really very simple.
I attached it for both IPv4 and IPv6 for iptables-1.2.7a.
Just needs an extra line in the ebuild:
patch -p0 < ${FILESDIR}/iptables.diff
Comment 1 fbusse 2002-11-14 07:37:07 UTC
Created attachment 5663 [details, diff]
Patch for iptables-save
Comment 2 Daniel Ahlberg (RETIRED) gentoo-dev 2002-11-20 08:22:57 UTC
Commited, thanks for finding this!