[openib-general] [PATCH repost] remove ip_dev_find from addr.c

Michael S. Tsirkin mst at mellanox.co.il
Tue Feb 28 08:48:50 PST 2006


Sean, this seems to work for me. Please test.

---

Remove dependency of addr.c on ip_dev_find so that we can work on vanilla
2.6.15.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: linux-2.6.15/drivers/infiniband/core/addr.c
===================================================================
--- linux-2.6.15.orig/drivers/infiniband/core/addr.c	2006-02-28 17:24:56.000000000 +0200
+++ linux-2.6.15/drivers/infiniband/core/addr.c	2006-02-28 18:14:12.000000000 +0200
@@ -46,6 +46,33 @@ MODULE_AUTHOR("Sean Hefty");
 MODULE_DESCRIPTION("IB Address Translation");
 MODULE_LICENSE("Dual BSD/GPL");
 
+static struct net_device *xxx_ip_dev_find(u32 addr)
+{
+	struct net_device *dev;
+	struct in_ifaddr **ifap;
+	struct in_ifaddr *ifa;
+	struct in_device *in_dev;
+
+	read_lock(&dev_base_lock);
+	for (dev = dev_base; dev; dev = dev->next)
+		if ((in_dev = in_dev_get(dev))) {
+			for (ifap = &in_dev->ifa_list; (ifa = *ifap);
+			     ifap = &ifa->ifa_next) {
+				if (addr == ifa->ifa_address) {
+					dev_hold(dev);
+					in_dev_put(in_dev);
+					goto found;
+				}
+			}
+			in_dev_put(in_dev);
+		}
+found:
+	read_unlock(&dev_base_lock);
+	return dev;
+}
+
+#define ip_dev_find xxx_ip_dev_find
+
 struct addr_req {
 	struct list_head list;
 	struct sockaddr src_addr;

-- 
Michael S. Tsirkin
Staff Engineer, Mellanox Technologies



More information about the general mailing list