[openib-general] [PATCH] sdp on vanilla 2.6.15

Michael S. Tsirkin mst at mellanox.co.il
Thu Jan 19 10:23:05 PST 2006


I find the following useful: it lets me load sdp on vanilla 2.6.15

---

ip_dev_find isnt exported to modules starting with 2.6.14

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

Index: linux-kernel/drivers/infiniband/ulp/sdp/sdp_link.c
===================================================================
--- linux-kernel/drivers/infiniband/ulp/sdp/sdp_link.c	(revision 4817)
+++ linux-kernel/drivers/infiniband/ulp/sdp/sdp_link.c	(working copy)
@@ -36,6 +36,30 @@
 #include "ipoib.h"
 #include "sdp_main.h"
 
+static int 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) {
+		for (ifap = &in_dev->ifa_list; (ifa = *ifap);
+		     ifap = &ifa->ifa_next) {
+			if (addr == ifa->ifa_address) {
+				dev_hold(dev);
+				goto found;
+			}
+		}
+	}
+found:
+	read_unlock(&dev_base_lock);
+	return dev;
+}
+
+#define ip_dev_find xxx_ip_dev_find
+
 #define SDP_LINK_F_VALID 0x01 /* valid path info record. */
 #define SDP_LINK_F_ARP   0x02 /* arp request in progress. */
 #define SDP_LINK_F_PATH  0x04 /* arp request in progress. */

-- 
MST



More information about the general mailing list