Commit d3984a6b authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[NETFILTER]: Fix ip6t_LOG MAC format

I broke this in the patch that consolidated MAC logging.
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 74bb421d
...@@ -373,9 +373,10 @@ ip6t_log_packet(unsigned int hooknum, ...@@ -373,9 +373,10 @@ ip6t_log_packet(unsigned int hooknum,
in ? in->name : "", in ? in->name : "",
out ? out->name : ""); out ? out->name : "");
if (in && !out) { if (in && !out) {
unsigned int len;
/* MAC logging for input chain only. */ /* MAC logging for input chain only. */
printk("MAC="); printk("MAC=");
if (skb->dev && skb->dev->hard_header_len && if (skb->dev && (len = skb->dev->hard_header_len) &&
skb->mac.raw != skb->nh.raw) { skb->mac.raw != skb->nh.raw) {
unsigned char *p = skb->mac.raw; unsigned char *p = skb->mac.raw;
int i; int i;
...@@ -384,9 +385,11 @@ ip6t_log_packet(unsigned int hooknum, ...@@ -384,9 +385,11 @@ ip6t_log_packet(unsigned int hooknum,
(p -= ETH_HLEN) < skb->head) (p -= ETH_HLEN) < skb->head)
p = NULL; p = NULL;
if (p != NULL) if (p != NULL) {
for (i = 0; i < skb->dev->hard_header_len; i++) for (i = 0; i < len; i++)
printk("%02x", p[i]); printk("%02x%s", p[i],
i == len - 1 ? "" : ":");
}
printk(" "); printk(" ");
if (skb->dev->type == ARPHRD_SIT) { if (skb->dev->type == ARPHRD_SIT) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment