* small buglet in iptables-save with "-m mac"
@ 2002-12-10 14:26 Roland Kuhn
2002-12-16 11:40 ` Michael Schwendt
0 siblings, 1 reply; 2+ messages in thread
From: Roland Kuhn @ 2002-12-10 14:26 UTC (permalink / raw)
To: netfilter-devel
Hi!
Please Cc: me as I'm not on the list.
This small buglet is biting me since quite a while, so I got the 1.2.7a source
to see if it is fixed, and it isn't: if you try iptables-save on a rule with
inverted MAC matching (e.g. "-m mac --mac-source ! xx:xx:xx:xx:xx:xx") you'll
end up with "-m mac --mac !xx:xx:xx:xx:xx:xx", which doesn't work because of the
missing space between the ! and the MAC. The patch below should fix it (tested
on RH7.2, kernel 2.4.20).
--- libipt_mac.c.bak Tue Dec 10 15:16:34 2002
+++ libipt_mac.c Tue Dec 10 15:17:04 2002
@@ -90,7 +90,7 @@
{
unsigned int i;
- printf("%s%02X", invert ? "!" : "", macaddress[0]);
+ printf("%s%02X", invert ? "! " : "", macaddress[0]);
for (i = 1; i < ETH_ALEN; i++)
printf(":%02X", macaddress[i]);
printf(" ");
Ciao,
Roland
+---------------------------+-------------------------+
| TU Muenchen | |
| Physik-Department E18 | Raum 3558 |
| James-Franck-Str. | Telefon 089/289-12592 |
| 85747 Garching | |
+---------------------------+-------------------------+
"If you think NT is the answer, you didn't understand the question."
- Paul Stephens
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: small buglet in iptables-save with "-m mac"
2002-12-10 14:26 small buglet in iptables-save with "-m mac" Roland Kuhn
@ 2002-12-16 11:40 ` Michael Schwendt
0 siblings, 0 replies; 2+ messages in thread
From: Michael Schwendt @ 2002-12-16 11:40 UTC (permalink / raw)
To: Roland Kuhn; +Cc: netfilter-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tue, 10 Dec 2002 15:26:30 +0100 (CET), Roland Kuhn wrote:
> Please Cc: me as I'm not on the list.
>
> This small buglet is biting me since quite a while, so I got the
> 1.2.7a source to see if it is fixed, and it isn't: if you try
> iptables-save on a rule with inverted MAC matching (e.g. "-m mac
> --mac-source ! xx:xx:xx:xx:xx:xx") you'll end up with "-m mac --mac
> !xx:xx:xx:xx:xx:xx", which doesn't work because of the missing space
> between the ! and the MAC. The patch below should fix it (tested on
> RH7.2, kernel 2.4.20).
This has been fixed several weeks ago in CVS.
Sometime later I've submitted a patch which cleans up libipt_mac.c
so the space is only printed for iptables-save and not for iptables
- -L (other userspace extension do it similarly with readability in
mind).
Michael
- --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
iD8DBQE9/bug0iMVcrivHFQRArKwAJ4jFlBLTGhhFzcPR4Z7aiEMtaOhIACfQt7U
rFm3uUrJdvmKrGF1l4nJSt0=
=GSMW
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-12-16 11:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-10 14:26 small buglet in iptables-save with "-m mac" Roland Kuhn
2002-12-16 11:40 ` Michael Schwendt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.