]> git.openfabrics.org - ~shefty/ibacm.git/commitdiff
Refresh of addrpre
authorSean Hefty <sean.hefty@intel.com>
Fri, 28 Jun 2013 23:04:39 +0000 (16:04 -0700)
committerSean Hefty <sean.hefty@intel.com>
Fri, 28 Jun 2013 23:04:39 +0000 (16:04 -0700)
src/acm.c

index 97e635196ebfb1188120bdc077ca1868ec4d6b49..4a9f7b26a9b8588606e7d2b211336006f37b0567 100644 (file)
--- a/src/acm.c
+++ b/src/acm.c
@@ -2832,11 +2832,11 @@ static void acm_parse_hosts_file(struct acm_ep *ep)
                        acm_log(0, "ERROR - %s is not IB GID\n", gid);
                        continue;
                }
-               if (inet_pton(AF_INET, addr, &ip_addr) > 0)
+               if (inet_pton(AF_INET, addr, &ip_addr) > 0) {
                        addr_type = ACM_ADDRESS_IP;
-               else if (inet_pton(AF_INET6, addr, &ip_addr) > 0)
+               } else if (inet_pton(AF_INET6, addr, &ip_addr) > 0) {
                        addr_type = ACM_ADDRESS_IP6;
-               else {
+               else {
                        acm_log(0, "ERROR - %s is not IP address\n", addr);
                        continue;
                }
@@ -2860,6 +2860,12 @@ static void acm_parse_hosts_file(struct acm_ep *ep)
                        dest->state = ACM_READY;
                        acm_put_dest(gid_dest);
                } else {
+                       memcpy(dest->path.dgid, &ib_addr, 16);
+                       //ibv_query_gid(ep->port->dev->verbs, ep->port->port_num,
+                       //              0, &dest->path.sgid);
+                       dest->path.slid = htons(ep->port->lid);
+                       dest->path.reversible_numpath = IBV_PATH_RECORD_REVERSIBLE;
+                       dest->path.pkey = htons(ep->pkey);
                        dest->state = ACM_ADDR_RESOLVED;
                }
 
@@ -2955,7 +2961,7 @@ static void acm_ep_preload(struct acm_ep *ep)
                        acm_log(0, "ERROR - failed to preload EP\n");
                break;
        default:
-               return;
+               break;
        }
 
        switch (addr_preload) {