]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg: fix encode function
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Tue, 5 May 2020 11:25:20 +0000 (11:25 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 8 Jul 2020 06:38:39 +0000 (06:38 +0000)
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 <lpetrut@cloudbasesolutions.com>
src/msg/msg_types.h

index 3caf83f24e5c021c5462d01557917975cb6b38c6..837474ec2397bfce9b3901f1a3fec2ea77097160 100644 (file)
@@ -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
 }