Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf377eb4 authored by Patrick McHardy's avatar Patrick McHardy
Browse files

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: default avatarPatrick McHardy <kaber@trash.net>
parent d70a011d
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -411,11 +411,11 @@ 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("%02x", *p++);
			for (i = 1; i < skb->dev->hard_header_len; i++, p++)
				printk(":%02x", *p);
		}
		printk(" ");
	}

+3 −3
Original line number Diff line number Diff line
@@ -414,9 +414,9 @@ ip6t_log_packet(u_int8_t pf,
				p = NULL;

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