Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2427
b: refs/heads/master
c: 047601b
h: refs/heads/master
i:
  2425: d44f318
  2423: e41bcfa
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Jun 21, 2005
1 parent 4cf00d3 commit 3295baf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2715bcf9efc34063e05009f188eb896c462ae925
refs/heads/master: 047601bf7c803724bbab9a4fdbad9481cecc12e0
54 changes: 19 additions & 35 deletions trunk/net/ipv6/netfilter/ip6t_LOG.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,6 @@ ip6t_log_packet(unsigned int hooknum,
const char *level_string,
const char *prefix)
{
struct ipv6hdr *ipv6h = skb->nh.ipv6h;

spin_lock_bh(&log_lock);
printk(level_string);
printk("%sIN=%s OUT=%s ",
Expand All @@ -377,39 +375,25 @@ ip6t_log_packet(unsigned int hooknum,
if (in && !out) {
/* MAC logging for input chain only. */
printk("MAC=");
if (skb->dev && skb->dev->hard_header_len && skb->mac.raw != (void*)ipv6h) {
if (skb->dev->type != ARPHRD_SIT){
int i;
unsigned char *p = skb->mac.raw;
for (i = 0; i < skb->dev->hard_header_len; i++,p++)
printk("%02x%c", *p,
i==skb->dev->hard_header_len - 1
? ' ':':');
} else {
int i;
unsigned char *p = skb->mac.raw;
if ( p - (ETH_ALEN*2+2) > skb->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 ((skb->dev->addr_len == 4) &&
skb->dev->hard_header_len > 20){
printk("TUNNEL=");
p = skb->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 (skb->dev && skb->dev->hard_header_len &&
skb->mac.raw != skb->nh.raw) {
unsigned char *p = skb->mac.raw;
int i;

if (skb->dev->type == ARPHRD_SIT &&
(p -= ETH_HLEN) < skb->head)
p = NULL;

if (p != NULL)
for (i = 0; i < skb->dev->hard_header_len; i++)
printk("%02x", p[i]);
printk(" ");

if (skb->dev->type == ARPHRD_SIT) {
struct iphdr *iph = (struct iphdr *)skb->mac.raw;
printk("TUNNEL=%u.%u.%u.%u->%u.%u.%u.%u ",
NIPQUAD(iph->saddr),
NIPQUAD(iph->daddr));
}
} else
printk(" ");
Expand Down

0 comments on commit 3295baf

Please sign in to comment.