From: Lucian Petrut Date: Tue, 5 May 2020 11:25:20 +0000 (+0000) Subject: msg: fix encode function X-Git-Tag: v16.1.0~1760^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d53728272c5e8e9f222a7aae607c2200c790a112;p=ceph.git msg: fix encode function This commit [1] refactored the "encode" function but didn't handle the variable names properly while moving code around, using the undefined "wireaddr" variable. [1] cf778097d6d4fdf4c178d0f6d1e1089d347ffc6d Signed-off-by: Lucian Petrut --- diff --git a/src/msg/msg_types.h b/src/msg/msg_types.h index 3caf83f24e5c0..837474ec2397b 100644 --- a/src/msg/msg_types.h +++ b/src/msg/msg_types.h @@ -193,9 +193,9 @@ static inline void encode(const sockaddr_storage& a, ceph::buffer::list& bl) { ::memcpy(dst, src, copy_size); encode(ss, bl); #else - ceph_sockaddr_storage ss{}; + ceph_sockaddr_storage ss; ::memset(&ss, '\0', sizeof(ss)); - ::memcpy(&wireaddr, &ss, std::min(sizeof(ss), sizeof(a))); + ::memcpy(&ss, &a, std::min(sizeof(ss), sizeof(a))); encode(ss, bl); #endif }