diff options
-rw-r--r-- | net/ipv6/netfilter/ip6t_LOG.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c index c44685e391b7..a692e26a4fa3 100644 --- a/net/ipv6/netfilter/ip6t_LOG.c +++ b/net/ipv6/netfilter/ip6t_LOG.c | |||
@@ -373,9 +373,10 @@ ip6t_log_packet(unsigned int hooknum, | |||
373 | in ? in->name : "", | 373 | in ? in->name : "", |
374 | out ? out->name : ""); | 374 | out ? out->name : ""); |
375 | if (in && !out) { | 375 | if (in && !out) { |
376 | unsigned int len; | ||
376 | /* MAC logging for input chain only. */ | 377 | /* MAC logging for input chain only. */ |
377 | printk("MAC="); | 378 | printk("MAC="); |
378 | if (skb->dev && skb->dev->hard_header_len && | 379 | if (skb->dev && (len = skb->dev->hard_header_len) && |
379 | skb->mac.raw != skb->nh.raw) { | 380 | skb->mac.raw != skb->nh.raw) { |
380 | unsigned char *p = skb->mac.raw; | 381 | unsigned char *p = skb->mac.raw; |
381 | int i; | 382 | int i; |
@@ -384,9 +385,11 @@ ip6t_log_packet(unsigned int hooknum, | |||
384 | (p -= ETH_HLEN) < skb->head) | 385 | (p -= ETH_HLEN) < skb->head) |
385 | p = NULL; | 386 | p = NULL; |
386 | 387 | ||
387 | if (p != NULL) | 388 | if (p != NULL) { |
388 | for (i = 0; i < skb->dev->hard_header_len; i++) | 389 | for (i = 0; i < len; i++) |
389 | printk("%02x", p[i]); | 390 | printk("%02x%s", p[i], |
391 | i == len - 1 ? "" : ":"); | ||
392 | } | ||
390 | printk(" "); | 393 | printk(" "); |
391 | 394 | ||
392 | if (skb->dev->type == ARPHRD_SIT) { | 395 | if (skb->dev->type == ARPHRD_SIT) { |