Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8704e9a8790cc9e394198663c1c9150c899fb9a2
Commit:     8704e9a8790cc9e394198663c1c9150c899fb9a2
Parent:     7c7a9bccd2ba9f17e4b588461f140578a0a7b073
Author:     Steve Wise <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 12 16:09:29 2008 -0600
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Wed Feb 13 07:47:42 2008 -0800

    RDMA/cxgb3: Fail loopback connections
    
    The cxgb3 HW and driver don't support loopback RDMA connections.  So
    fail any connection attempt where the destination address is local.
    
    Signed-off-by: Steve Wise <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/cxgb3/iwch_cm.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c 
b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index e9a08fa..320f2b6 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -35,6 +35,7 @@
 #include <linux/skbuff.h>
 #include <linux/timer.h>
 #include <linux/notifier.h>
+#include <linux/inetdevice.h>
 
 #include <net/neighbour.h>
 #include <net/netevent.h>
@@ -1784,6 +1785,17 @@ err:
        return err;
 }
 
+static int is_loopback_dst(struct iw_cm_id *cm_id)
+{
+       struct net_device *dev;
+
+       dev = ip_dev_find(&init_net, cm_id->remote_addr.sin_addr.s_addr);
+       if (!dev)
+               return 0;
+       dev_put(dev);
+       return 1;
+}
+
 int iwch_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
 {
        int err = 0;
@@ -1791,6 +1803,11 @@ int iwch_connect(struct iw_cm_id *cm_id, struct 
iw_cm_conn_param *conn_param)
        struct iwch_ep *ep;
        struct rtable *rt;
 
+       if (is_loopback_dst(cm_id)) {
+               err = -ENOSYS;
+               goto out;
+       }
+
        ep = alloc_ep(sizeof(*ep), GFP_KERNEL);
        if (!ep) {
                printk(KERN_ERR MOD "%s - cannot alloc ep.\n", __FUNCTION__);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to