netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] netfilter: xt_LOG: do print MAC header on FORWARD
@ 2010-11-14 18:01 Jan Engelhardt
  2010-11-15  1:30 ` Jan Engelhardt
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Engelhardt @ 2010-11-14 18:01 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Netfilter Developer Mailing List

parent 4e2861b87e1ee692bb02a5e54b1e530c6e319668 (v2.6.37-rc1-191-g4e2861b)
commit 6c0146f3e3e75738fabfbd17b01f43b8bd1830d6
Author: Jan Engelhardt <jengelh@medozas.de>
Date:   Sun Nov 14 17:35:40 2010 +0100

netfilter: xt_LOG: do print MAC header on FORWARD

I am observing consistent behavior even with bridges, so let's unlock
this. xt_mac is already usable in FORWARD, too. Section 9 of
http://ebtables.sourceforge.net/br_fw_ia/br_fw_ia.html#section9 says
the MAC source address is changed, but my observation does not match
that claim -- the MAC header is retained.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
 net/ipv4/netfilter/ipt_LOG.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c
index 72ffc8f..d76d6c9 100644
--- a/net/ipv4/netfilter/ipt_LOG.c
+++ b/net/ipv4/netfilter/ipt_LOG.c
@@ -442,8 +442,7 @@ ipt_log_packet(u_int8_t pf,
 	}
 #endif
 
-	/* MAC logging for input path only. */
-	if (in && !out)
+	if (in != NULL)
 		dump_mac_header(m, loginfo, skb);
 
 	dump_packet(m, loginfo, skb, 0);
-- 
# Created with git-export-patch


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

* Re: [patch] netfilter: xt_LOG: do print MAC header on FORWARD
  2010-11-14 18:01 [patch] netfilter: xt_LOG: do print MAC header on FORWARD Jan Engelhardt
@ 2010-11-15  1:30 ` Jan Engelhardt
  2010-11-15 10:24   ` Patrick McHardy
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Engelhardt @ 2010-11-15  1:30 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Netfilter Developer Mailing List


On Sunday 2010-11-14 19:01, Jan Engelhardt wrote:
>netfilter: xt_LOG: do print MAC header on FORWARD
>---
> net/ipv4/netfilter/ipt_LOG.c |    3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)

And here's a patch that does both v4 and v6.


parent 4e2861b87e1ee692bb02a5e54b1e530c6e319668 (v2.6.37-rc1-191-g4e2861b)
commit 5c6c157ce41af5566baf472782948e38c8d5d83f
Author: Jan Engelhardt <jengelh@medozas.de>
Date:   Sun Nov 14 17:35:40 2010 +0100

netfilter: xt_LOG: do print MAC header on FORWARD

I am observing consistent behavior even with bridges, so let's unlock
this. xt_mac is already usable in FORWARD, too. Section 9 of
http://ebtables.sourceforge.net/br_fw_ia/br_fw_ia.html#section9 says
the MAC source address is changed, but my observation does not match
that claim -- the MAC header is retained.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
 net/ipv4/netfilter/ipt_LOG.c  |    3 +--
 net/ipv6/netfilter/ip6t_LOG.c |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c
index 72ffc8f..d76d6c9 100644
--- a/net/ipv4/netfilter/ipt_LOG.c
+++ b/net/ipv4/netfilter/ipt_LOG.c
@@ -442,8 +442,7 @@ ipt_log_packet(u_int8_t pf,
 	}
 #endif
 
-	/* MAC logging for input path only. */
-	if (in && !out)
+	if (in != NULL)
 		dump_mac_header(m, loginfo, skb);
 
 	dump_packet(m, loginfo, skb, 0);
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c
index 09c8889..05027b7 100644
--- a/net/ipv6/netfilter/ip6t_LOG.c
+++ b/net/ipv6/netfilter/ip6t_LOG.c
@@ -452,8 +452,7 @@ ip6t_log_packet(u_int8_t pf,
 	       in ? in->name : "",
 	       out ? out->name : "");
 
-	/* MAC logging for input path only. */
-	if (in && !out)
+	if (in != NULL)
 		dump_mac_header(m, loginfo, skb);
 
 	dump_packet(m, loginfo, skb, skb_network_offset(skb), 1);
-- 
# Created with git-export-patch

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

* Re: [patch] netfilter: xt_LOG: do print MAC header on FORWARD
  2010-11-15  1:30 ` Jan Engelhardt
@ 2010-11-15 10:24   ` Patrick McHardy
  0 siblings, 0 replies; 3+ messages in thread
From: Patrick McHardy @ 2010-11-15 10:24 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Netfilter Developer Mailing List

On 15.11.2010 02:30, Jan Engelhardt wrote:
> netfilter: xt_LOG: do print MAC header on FORWARD
> 
> I am observing consistent behavior even with bridges, so let's unlock
> this. xt_mac is already usable in FORWARD, too. Section 9 of
> http://ebtables.sourceforge.net/br_fw_ia/br_fw_ia.html#section9 says
> the MAC source address is changed, but my observation does not match
> that claim -- the MAC header is retained.

I've checked the code and I think you're right, even IPsec tunnels
make sure to preserve the original MAC header.

Applied, thanks.

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

end of thread, other threads:[~2010-11-15 10:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-14 18:01 [patch] netfilter: xt_LOG: do print MAC header on FORWARD Jan Engelhardt
2010-11-15  1:30 ` Jan Engelhardt
2010-11-15 10:24   ` Patrick McHardy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).