From b88e41ab53da1f00a0fe9e5ddcb17eef1e1ef84a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 6 May 2016 09:46:55 -0400 Subject: [PATCH] libcephfs: use entity_addr_t::get_sockaddr_storage() Signed-off-by: Sage Weil --- src/libcephfs.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcephfs.cc b/src/libcephfs.cc index a9fa5b3a86d..4c56ee04cc3 100644 --- a/src/libcephfs.cc +++ b/src/libcephfs.cc @@ -1218,7 +1218,7 @@ extern "C" int ceph_get_osd_addr(struct ceph_mount_info *cmount, int osd, if (ret < 0) return ret; - memcpy(addr, &address.ss_addr(), sizeof(*addr)); + *addr = address.get_sockaddr_storage(); return 0; } @@ -1241,7 +1241,7 @@ extern "C" int ceph_get_file_stripe_address(struct ceph_mount_info *cmount, int return r; for (i = 0; i < (unsigned)naddr && i < address.size(); i++) - memcpy(&addr[i], &address[i].ss_addr(), sizeof(*addr)); + addr[i] = address[i].get_sockaddr_storage(); /* naddr == 0: drop through and return actual size */ if (naddr && (address.size() > (unsigned)naddr))