spin_lock(&conn_lock);
list_for_each(tmp, &conn_list) {
c = list_entry(tmp, struct ptlrpc_connection, c_link);
- if (!memcmp(peer, &c->c_peer, sizeof(struct ptlrpc_peer)) &&
+ if (memcmp(peer, &c->c_peer, sizeof(*peer)) == 0 &&
peer->peer_ni == c->c_peer.peer_ni) {
ptlrpc_connection_addref(c);
GOTO(out, c);
list_for_each_safe(tmp, pos, &conn_unused_list) {
c = list_entry(tmp, struct ptlrpc_connection, c_link);
- if (!memcmp(peer, &c->c_peer, sizeof(struct ptlrpc_peer)) &&
+ if (memcmp(peer, &c->c_peer, sizeof(*peer)) == 0 &&
peer->peer_ni == c->c_peer.peer_ni) {
ptlrpc_connection_addref(c);
list_del(&c->c_link);
GOTO(out, c);
if (uuid && uuid->uuid) /* XXX ???? */
- obd_str2uuid(&c->c_remote_uuid, uuid->uuid);
+ obd_str2uuid(&c->c_remote_uuid, (char *)uuid->uuid);
atomic_set(&c->c_refcount, 0);
memcpy(&c->c_peer, peer, sizeof(c->c_peer));