All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Marek Lindner <mareklindner@neomailbox.ch>,
	Simon Wunderlich <sw@simonwunderlich.de>,
	Antonio Quartulli <a@unstable.cc>
Cc: "David S. Miller" <davem@davemloft.net>,
	b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [B.A.T.M.A.N.] Odd use of %14pM in net/batman-adv/distributed-arp-table.c
Date: Tue, 13 Jun 2017 14:51:41 -0700	[thread overview]
Message-ID: <1497390701.18751.26.camel@perches.com> (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


WARNING: multiple messages have this Message-ID (diff)
From: Joe Perches <joe@perches.com>
To: Marek Lindner <mareklindner@neomailbox.ch>,
	Simon Wunderlich <sw@simonwunderlich.de>,
	Antonio Quartulli <a@unstable.cc>
Cc: "David S. Miller" <davem@davemloft.net>,
	b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Odd use of %14pM in net/batman-adv/distributed-arp-table.c
Date: Tue, 13 Jun 2017 14:51:41 -0700	[thread overview]
Message-ID: <1497390701.18751.26.camel@perches.com> (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

WARNING: multiple messages have this Message-ID (diff)
From: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
To: Marek Lindner
	<mareklindner-rVWd3aGhH2z5bpWLKbzFeg@public.gmane.org>,
	Simon Wunderlich
	<sw-2YrNx6rUIHYiY0qSoAWiAoQuADTiUCJX@public.gmane.org>,
	Antonio Quartulli <a@unstable.cc>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r@public.gmane.org,
	"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Odd use of %14pM in net/batman-adv/distributed-arp-table.c
Date: Tue, 13 Jun 2017 14:51:41 -0700	[thread overview]
Message-ID: <1497390701.18751.26.camel@perches.com> (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

             reply	other threads:[~2017-06-13 21:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-13 21:51 Joe Perches [this message]
2017-06-13 21:51 ` Odd use of %14pM in net/batman-adv/distributed-arp-table.c Joe Perches
2017-06-13 21:51 ` Joe Perches
2017-06-14  8:23 ` [B.A.T.M.A.N.] " Sven Eckelmann
2017-06-14  9:32   ` Joe Perches
2017-06-14  9:32     ` Joe Perches
2017-06-14  9:33   ` [B.A.T.M.A.N.] [PATCH] batman-adv: Remove unnecessary length qualifier in %14pM Joe Perches
2017-06-14  9:33     ` Joe Perches
2017-06-14  9:33     ` Joe Perches
2017-06-14 19:20     ` [B.A.T.M.A.N.] " David Miller
2017-06-14 19:20       ` David Miller
2017-06-14 19:41     ` [B.A.T.M.A.N.] " Sven Eckelmann
2017-06-14 19:41       ` Sven Eckelmann
2017-06-14 19:41       ` Sven Eckelmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1497390701.18751.26.camel@perches.com \
    --to=joe@perches.com \
    --cc=a@unstable.cc \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mareklindner@neomailbox.ch \
    --cc=netdev@vger.kernel.org \
    --cc=sw@simonwunderlich.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.