All of lore.kernel.org
 help / color / mirror / Atom feed
* 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

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.