Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1665228

Odd use of %14pM in net/batman-adv/distributed-arp-table.c

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Odd use of %14pM in net/batman-adv/distributed-arp-table.c
Date 2017-06-14 00:00 +0200
Message-ID <tS20V-4RM-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


An output mac address is 17 bytes

         1
12345678901234567
00:11:22:33:44:55

but in net/batman-adv/distributed-arp-table.c

int batadv_dat_cache_seq_print_text(struct seq_file *seq, void *offset)
{
[...]
			seq_printf(seq, " * %15pI4 %14pM %4i %6i:%02i\n",
				   &dat_entry->ip, dat_entry->mac_addr,
				   batadv_print_vid(dat_entry->vid),
				   last_seen_mins, last_seen_secs);

%14pM is odd as this should not emit the last byte of the
mac address.  So given the example above, it would output
00:11:22:33:44

Is that what's really desired?

If so, I'd suggest using something more obvious like %5phC

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Odd use of %14pM in net/batman-adv/distributed-arp-table.c Joe Perches <joe@perches.com> - 2017-06-14 00:00 +0200
  Re: [B.A.T.M.A.N.] Odd use of %14pM in net/batman-adv/distributed-arp-table.c Sven Eckelmann <sven@narfation.org> - 2017-06-14 10:30 +0200
    Re: [B.A.T.M.A.N.] Odd use of %14pM in  net/batman-adv/distributed-arp-table.c Joe Perches <joe@perches.com> - 2017-06-14 11:40 +0200
    [PATCH] batman-adv: Remove unnecessary length qualifier in %14pM Joe Perches <joe@perches.com> - 2017-06-14 11:40 +0200
      Re: [PATCH] batman-adv: Remove unnecessary length qualifier in  %14pM David Miller <davem@davemloft.net> - 2017-06-14 21:30 +0200
      Re: [PATCH] batman-adv: Remove unnecessary length qualifier in %14pM Sven Eckelmann <sven@narfation.org> - 2017-06-14 21:50 +0200

csiph-web