diff options
| author | Harald Welte <laforge@gnumonks.org> | 2002-10-13 14:38:43 -0700 |
|---|---|---|
| committer | David S. Miller <davem@nuts.ninka.net> | 2002-10-13 14:38:43 -0700 |
| commit | 1fc9d1fb59604a28d228d9c97117bdd2bb2be2c5 (patch) | |
| tree | f6ebdb73036ec2ab39afc408c332e7bdc625aa08 | |
| parent | 39558bdc134fa25ff1a0e3beb7acddf7b2a8e9f3 (diff) | |
net/ipv6/netfilter/ip6t_LOG.c: Display ipv4 encapsulation properly.
| -rw-r--r-- | net/ipv6/netfilter/ip6t_LOG.c | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c index f3f0092c6d8f..6a1b7974021b 100644 --- a/net/ipv6/netfilter/ip6t_LOG.c +++ b/net/ipv6/netfilter/ip6t_LOG.c @@ -289,12 +289,39 @@ ip6t_log_target(struct sk_buff **pskb, /* MAC logging for input chain only. */ printk("MAC="); if ((*pskb)->dev && (*pskb)->dev->hard_header_len && (*pskb)->mac.raw != (void*)ipv6h) { - int i; - unsigned char *p = (*pskb)->mac.raw; - for (i = 0; i < (*pskb)->dev->hard_header_len; i++,p++) + 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 - ? ' ':':'); + 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 ? ' ' : '.'); + } + } } else printk(" "); } |
