netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Some NIPQUAD_FMT -> %pI4 conversions are broken
@ 2009-01-10  3:47 Roland Dreier
  2009-01-10  6:07 ` Harvey Harrison
  2009-01-10  6:24 ` [PATCH] nes: fix reversed IP address Harvey Harrison
  0 siblings, 2 replies; 6+ messages in thread
From: Roland Dreier @ 2009-01-10  3:47 UTC (permalink / raw)
  To: Harvey Harrison, netdev

I just noticed (by getting a messed up print in my kernel log) that most
of the changes to drivers/infiniband/hw/nes in commit 63779436
("drivers: replace NIPQUAD()") were wrong: the idea was to change printk
statements like

	printk("..." NIPQUAD_FMT "...", NIPQUAD(foo));

but most of the changes in nes were to code like

	printk("..." NIPQUAD_FMT "...", HIPQUAD(foo));

ie *H* IPQUAD not *N* IPQUAD, indicating the foo is in host endian
order, and hence the new code

	printk("...%pI4...", &foo);

prints the IP in reverse order now.

I don't see a good way to fix this without introducing a temporary
variable to hold a swapped IP address... but is there a better way?

 - R.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-01-10  6:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-10  3:47 Some NIPQUAD_FMT -> %pI4 conversions are broken Roland Dreier
2009-01-10  6:07 ` Harvey Harrison
2009-01-10  6:15   ` David Miller
2009-01-10  6:24     ` Harvey Harrison
2009-01-10  6:24 ` [PATCH] nes: fix reversed IP address Harvey Harrison
2009-01-10  6:49   ` Harvey Harrison

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).