]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
msg/msg_type: entity_addr_t: fix legacy decode
authorSage Weil <sage@redhat.com>
Wed, 16 Jan 2019 13:13:14 +0000 (07:13 -0600)
committerSage Weil <sage@redhat.com>
Wed, 16 Jan 2019 14:30:44 +0000 (08:30 -0600)
commit88824a97508d2593cde7370c7b663ed9cd7517b4
treeed77cdcc9b365230e395137c44d0dce5df23cb43
parent469f02d6c153a2be82101487fe4d179fc7478a2e
msg/msg_type: entity_addr_t: fix legacy decode

If we decode a zeroed sockaddr, we should end up with a TYPE_NONE
entity_addr_t, not v1::/0.

This was obscured by unit test TestAddrvecEncodeAddrDecode3, which
took an addrvec with all v2 addrs, decoded to an addr variable that
previously had v1:1.2.3.4:/0, and asserted the result was not v1::/0.
The test passed before because the set_sockaddr() failed on AF_UNSPEC
and the addr kept v1:1.2.3.4, but with the previous commit it failed
because it equaled v1::/0.  In reality, addr should get - (addr TYPE_NONE).

The TestEmptyAddrvecEncodeAddrDecode test case is similarly adjusted.

Signed-off-by: Sage Weil <sage@redhat.com>
src/msg/msg_types.h
src/test/test_addrs.cc