* [NETFILTER 2.4 4/6]: Fix ip6t_LOG sit tunnel logging
@ 2005-08-01 0:42 Patrick McHardy
0 siblings, 0 replies; only message in thread
From: Patrick McHardy @ 2005-08-01 0:42 UTC (permalink / raw)
To: David S. Miller; +Cc: Netfilter Development Mailinglist
[-- Attachment #1: 4.diff --]
[-- Type: text/x-patch, Size: 2891 bytes --]
[NETFILTER]: Fix ip6t_LOG sit tunnel logging
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
commit 3828b256e2b5adae44649792fee705bc91b1c44a
tree cc9fd8c21d707864d11181326f0ab86f202bdae8
parent 387a85697670fa620cf91969bd97f01687e83b20
author Patrick McHardy <kaber@trash.net> Sun, 31 Jul 2005 20:24:37 +0200
committer Patrick McHardy <kaber@trash.net> Sun, 31 Jul 2005 20:24:37 +0200
net/ipv6/netfilter/ip6t_LOG.c | 58 +++++++++++++++++------------------------
1 files changed, 24 insertions(+), 34 deletions(-)
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c
--- a/net/ipv6/netfilter/ip6t_LOG.c
+++ b/net/ipv6/netfilter/ip6t_LOG.c
@@ -363,7 +363,6 @@ ip6t_log_target(struct sk_buff **pskb,
const void *targinfo,
void *userinfo)
{
- struct ipv6hdr *ipv6h = (*pskb)->nh.ipv6h;
const struct ip6t_log_info *loginfo = targinfo;
char level_string[4] = "< >";
@@ -375,41 +374,32 @@ ip6t_log_target(struct sk_buff **pskb,
in ? in->name : "",
out ? out->name : "");
if (in && !out) {
+ unsigned int len;
/* MAC logging for input chain only. */
printk("MAC=");
- if ((*pskb)->dev && (*pskb)->dev->hard_header_len && (*pskb)->mac.raw != (void*)ipv6h) {
- if ((*pskb)->dev->type != ARPHRD_SIT){
- int i;
- unsigned char *p = (*pskb)->mac.raw;
- for (i = 0; i < (*pskb)->dev->hard_header_len; i++,p++)
- printk("%02x%c", *p,
- i==(*pskb)->dev->hard_header_len - 1
- ? ' ':':');
- } else {
- int i;
- unsigned char *p = (*pskb)->mac.raw;
- if ( p - (ETH_ALEN*2+2) > (*pskb)->head ){
- p -= (ETH_ALEN+2);
- for (i = 0; i < (ETH_ALEN); i++,p++)
- printk("%02x%s", *p,
- i == ETH_ALEN-1 ? "->" : ":");
- p -= (ETH_ALEN*2);
- for (i = 0; i < (ETH_ALEN); i++,p++)
- printk("%02x%c", *p,
- i == ETH_ALEN-1 ? ' ' : ':');
- }
-
- if (((*pskb)->dev->addr_len == 4) &&
- (*pskb)->dev->hard_header_len > 20){
- printk("TUNNEL=");
- p = (*pskb)->mac.raw + 12;
- for (i = 0; i < 4; i++,p++)
- printk("%3d%s", *p,
- i == 3 ? "->" : ".");
- for (i = 0; i < 4; i++,p++)
- printk("%3d%c", *p,
- i == 3 ? ' ' : '.');
- }
+ if ((*pskb)->dev && (len = (*pskb)->dev->hard_header_len) &&
+ (*pskb)->mac.raw != (*pskb)->nh.raw) {
+ unsigned char *p = (*pskb)->mac.raw;
+ int i;
+
+ if ((*pskb)->dev->type == ARPHRD_SIT &&
+ (p -= ETH_HLEN) < (*pskb)->head)
+ p = NULL;
+
+ if (p != NULL) {
+ for (i = 0; i < len; i++)
+ printk("%02x%s", p[i],
+ i == len - 1 ? "" : ":");
+ }
+ printk(" ");
+
+ if ((*pskb)->dev->type == ARPHRD_SIT) {
+ struct iphdr *iph;
+
+ iph = (struct iphdr *)(*pskb)->mac.raw;
+ printk("TUNNEL=%u.%u.%u.%u->%u.%u.%u.%u ",
+ NIPQUAD(iph->saddr),
+ NIPQUAD(iph->daddr));
}
} else
printk(" ");
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-08-01 0:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-01 0:42 [NETFILTER 2.4 4/6]: Fix ip6t_LOG sit tunnel logging Patrick McHardy
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.