All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] save inverted MAC match
@ 2002-11-06 16:21 Michael Schwendt
  2002-11-14 22:43 ` Michael Schwendt
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Schwendt @ 2002-11-06 16:21 UTC (permalink / raw)
  To: netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 794 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The "mac" userspace extension contains a minor bug for both IPv4 and
IPv6. Upon printing/saving a rule which matches inverted MAC
addresses, a space character is missing between the '!' prefix and
the MAC address. Hence iptables-restore fails to parse the output of
iptables-save. iptables 1.2.5, 1.2.6a, 1.2.7a and CVS are affected.

Steps to reproduce:

  iptables -N test
  iptables -I test -m mac --mac-source ! 01:02:03:04:05:06
  iptables-save | iptables-restore

Further reference:

  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=77337

- -- 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE9yUF+0iMVcrivHFQRAoq1AJ44yEEvEBrsCcmVmKsOT1ouMgkZVACggArR
Wor0AECzGmXPdLCpo8qmwZQ=
=jYEu
-----END PGP SIGNATURE-----

[-- Attachment #2: iptables-1.2.7a-invertmac.patch --]
[-- Type: application/octet-stream, Size: 1049 bytes --]

Red Hat Linux bug #77337: Add missing space between '!' and MAC
address upon printing/saving rules.

diff -Naur iptables-1.2.7a-orig/extensions/libip6t_mac.c iptables-1.2.7a/extensions/libip6t_mac.c
--- iptables-1.2.7a-orig/extensions/libip6t_mac.c	Wed May 29 15:08:16 2002
+++ iptables-1.2.7a/extensions/libip6t_mac.c	Wed Nov  6 16:50:17 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(" ");
diff -Naur iptables-1.2.7a-orig/extensions/libipt_mac.c iptables-1.2.7a/extensions/libipt_mac.c
--- iptables-1.2.7a-orig/extensions/libipt_mac.c	Wed May 29 15:08:16 2002
+++ iptables-1.2.7a/extensions/libipt_mac.c	Wed Nov  6 16:50:30 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(" ");

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-12-12 17:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-06 16:21 [PATCH] save inverted MAC match Michael Schwendt
2002-11-14 22:43 ` Michael Schwendt
2002-12-12 17:27   ` 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.