summaryrefslogtreecommitdiff
path: root/net/ipv4
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2010-06-28 14:12:41 +0200
committerPatrick McHardy <kaber@trash.net>2010-06-28 14:12:41 +0200
commitcf377eb4aeded926375d4d0fe0b66ba95f0521e1 (patch)
tree010628b36c81d050f4189fb8e94f0cdec60dc3c0 /net/ipv4
parentd70a011dbbaa6335a19deb63ec3eb613f48faafd (diff)
netfilter: ipt_LOG/ip6t_LOG: remove comparison within loop
Remove the comparison within the loop to print the macheader by prepending the colon to all but the first printk. Based on suggestion by Jan Engelhardt <jengelh@medozas.de>. Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/netfilter/ipt_LOG.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c
index 5234f4f3499a..0a452a54adbe 100644
--- a/net/ipv4/netfilter/ipt_LOG.c
+++ b/net/ipv4/netfilter/ipt_LOG.c
@@ -411,12 +411,12 @@ ipt_log_packet(u_int8_t pf,
skb->mac_header != skb->network_header) {
int i;
const unsigned char *p = skb_mac_header(skb);
- for (i = 0; i < skb->dev->hard_header_len; i++,p++)
- printk("%02x%c", *p,
- i==skb->dev->hard_header_len - 1
- ? ' ':':');
- } else
- printk(" ");
+
+ printk("%02x", *p++);
+ for (i = 1; i < skb->dev->hard_header_len; i++, p++)
+ printk(":%02x", *p);
+ }
+ printk(" ");
}
dump_packet(loginfo, skb, 0);