mirror of
https://github.com/ceph/ceph
synced 2025-01-03 09:32:43 +00:00
Merge pull request #1888 from ceph/wip-8472
msg_types.h: Don't use strncmp for comparing sockaddr_in. Reviewed-by: Loic Dachary <loic@dachary.org>
This commit is contained in:
commit
8691773ef0
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user