[openib-general] [PATCH] SDP: In do_link_path_lookup, make sure device is IPoIB hardware type

Hal Rosenstock halr at voltaire.com
Tue Sep 27 04:22:19 PDT 2005


In do_link_path_lookup, make sure device selected is IPoIB hardware
type before accessing its local private data

Signed-off-by: Hal Rosenstock <halr at voltaire.com>

Index: sdp_link.c
===================================================================
--- sdp_link.c  (revision 3552)
+++ sdp_link.c  (working copy)
@@ -433,7 +433,8 @@ static void do_link_path_lookup(struct s
        info->gw  = rt->rt_gateway;
        info->src = rt->rt_src;     /* true source IP address */
 
-       if (dev->flags & IFF_LOOPBACK) {
+       if (dev->flags & IFF_LOOPBACK ||
+           dev->type != ARPHRD_INFINIBAND) {
                dev_put(dev);
                while ((dev = dev_get_by_index(++counter))) {
                        if (dev->type == ARPHRD_INFINIBAND &&





More information about the general mailing list