Patchwork nes: fix reversed IP address

login
register
mail settings
Submitter Harvey Harrison
Date Jan. 10, 2009, 6:24 a.m.
Message ID <1231568675.5714.25.camel@brick>
Download mbox | patch
Permalink /patch/17720/
State Superseded
Delegated to: David Miller
Headers show

Comments

Harvey Harrison - Jan. 10, 2009, 6:24 a.m.
commit 63779436ab4ad0867bcea53bf853b0004d7b895di (drivers: replace NIPQUAD())
accidentally replaced two HIPQUAD()s causing IP addresses to be
printed in reverse order, add two temporary local vars.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
I'll start working on a patch working directly with _be32s, but this
is the safest for now.

 drivers/infiniband/hw/nes/nes_cm.c    |    3 ++-
 drivers/infiniband/hw/nes/nes_utils.c |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
Harvey Harrison - Jan. 10, 2009, 6:49 a.m.
On Fri, 2009-01-09 at 22:24 -0800, Harvey Harrison wrote:
> commit 63779436ab4ad0867bcea53bf853b0004d7b895di (drivers: replace NIPQUAD())
> accidentally replaced two HIPQUAD()s causing IP addresses to be
> printed in reverse order, add two temporary local vars.
> 
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> ---

Sorry missed a git add after catching the other hunks, will get this
right in the morning.

Harvey

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index 6ba57e9..2395b20 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -778,12 +778,13 @@  static struct nes_cm_node *find_node(struct nes_cm_core *cm_core,
 	unsigned long flags;
 	struct list_head *hte;
 	struct nes_cm_node *cm_node;
+	__be32 tmp_addr = cpu_to_be32(loc_addr);
 
 	/* get a handle on the hte */
 	hte = &cm_core->connected_nodes;
 
 	nes_debug(NES_DBG_CM, "Searching for an owner node: %pI4:%x from core %p->%p\n",
-		  &loc_addr, loc_port, cm_core, hte);
+		  &tmp_addr, loc_port, cm_core, hte);
 
 	/* walk list and find cm_node associated with this session ID */
 	spin_lock_irqsave(&cm_core->ht_lock, flags);
diff --git a/drivers/infiniband/hw/nes/nes_utils.c b/drivers/infiniband/hw/nes/nes_utils.c
index aa9b734..feb7401 100644
--- a/drivers/infiniband/hw/nes/nes_utils.c
+++ b/drivers/infiniband/hw/nes/nes_utils.c
@@ -655,6 +655,7 @@  int nes_arp_table(struct nes_device *nesdev, u32 ip_addr, u8 *mac_addr, u32 acti
 	struct nes_adapter *nesadapter = nesdev->nesadapter;
 	int arp_index;
 	int err = 0;
+	__be32 tmp_addr = cpu_to_be32(ip_addr);
 
 	for (arp_index = 0; (u32) arp_index < nesadapter->arp_table_size; arp_index++) {
 		if (nesadapter->arp_table[arp_index].ip_addr == ip_addr)
@@ -683,7 +684,7 @@  int nes_arp_table(struct nes_device *nesdev, u32 ip_addr, u8 *mac_addr, u32 acti
 	/* DELETE or RESOLVE */
 	if (arp_index == nesadapter->arp_table_size) {
 		nes_debug(NES_DBG_NETDEV, "MAC for %pI4 not in ARP table - cannot %s\n",
-			  &ip_addr, action == NES_ARP_RESOLVE ? "resolve" : "delete");
+			  &tmp_addr, action == NES_ARP_RESOLVE ? "resolve" : "delete");
 		return -1;
 	}