jgunthorpe / python-rdma

Python interface to the Linux RDMA stack
https://jgunthorpe.github.io/python-rdma/
Other
105 stars 31 forks source link

Bug in ibverbs.pyx::to_ah_attr #24

Open alex-zadara opened 4 years ago

alex-zadara commented 4 years ago
diff --git a/rdma/ibverbs.pyx b/rdma/ibverbs.pyx
index 16891a6..59bddf0 100644
--- a/rdma/ibverbs.pyx
+++ b/rdma/ibverbs.pyx
@@ -108,7 +108,7 @@ cdef to_ah_attr(c.ibv_ah_attr *cattr, object attr):
                 raise TypeError("attr.grh must be a global_route")
             if not isinstance(attr.grh.dgid, IBA.GID):
                 raise TypeError("attr.grh.dgid must be an IBA.GID")
-            tmp = <uint8_t *>PyString_AsString(attr.DGID);
+            tmp = <uint8_t *>PyString_AsString(attr.grh.dgid);
             for 0 <= i < 16:
                 cattr.grh.dgid.raw[i] = tmp[i];
             cattr.grh.flow_label = attr.grh.flow_label
@@ -466,6 +466,22 @@ cdef class Context:
                          active_speed = cattr.active_speed,
                          phys_state = cattr.phys_state)
jgunthorpe commented 4 years ago

can you send these two as a pull request?