diff --git a/src/msg/msg_types.h b/src/msg/msg_types.h index 5d86b3a229e..d259e528947 100644 --- a/src/msg/msg_types.h +++ b/src/msg/msg_types.h @@ -27,10 +27,10 @@ namespace ceph { } inline bool operator==(const sockaddr_in& a, const sockaddr_in& b) { - return strncmp((const char*)&a, (const char*)&b, sizeof(a)) == 0; + return memcmp((const char*)&a, (const char*)&b, sizeof(a)) == 0; } inline bool operator!=(const sockaddr_in& a, const sockaddr_in& b) { - return strncmp((const char*)&a, (const char*)&b, sizeof(a)) != 0; + return memcmp((const char*)&a, (const char*)&b, sizeof(a)) != 0; } extern ostream& operator<<(ostream& out, const sockaddr_storage &ss);