Skip to content

Commit

Permalink
[NETFILTER]: Fix ip6t_LOG MAC format
Browse files Browse the repository at this point in the history
I broke this in the patch that consolidated MAC logging.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Jul 22, 2005
1 parent 74bb421 commit d3984a6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions net/ipv6/netfilter/ip6t_LOG.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,10 @@ ip6t_log_packet(unsigned int hooknum,
in ? in->name : "",
out ? out->name : "");
if (in && !out) {
unsigned int len;
/* MAC logging for input chain only. */
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) {
unsigned char *p = skb->mac.raw;
int i;
Expand All @@ -384,9 +385,11 @@ ip6t_log_packet(unsigned int hooknum,
(p -= ETH_HLEN) < skb->head)
p = NULL;

if (p != NULL)
for (i = 0; i < skb->dev->hard_header_len; i++)
printk("%02x", p[i]);
if (p != NULL) {
for (i = 0; i < len; i++)
printk("%02x%s", p[i],
i == len - 1 ? "" : ":");
}
printk(" ");

if (skb->dev->type == ARPHRD_SIT) {
Expand Down

0 comments on commit d3984a6

Please sign in to comment.