OSDN Git Service

libceph: treat sockaddr_storage with uninitialized family as blank
authorIlya Dryomov <idryomov@gmail.com>
Thu, 9 Jul 2015 10:57:52 +0000 (13:57 +0300)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 9 Jul 2015 17:30:34 +0000 (20:30 +0300)
commitc44bd69c0c8cfadf0239437635b2933efb1f6c4c
tree39ad695bef47fc7707433305820dbd56a6c93e0c
parent757856d2b9568a701df9ea6a4be68effbb9d6f44
libceph: treat sockaddr_storage with uninitialized family as blank

addr_is_blank() should return true if family is neither AF_INET nor
AF_INET6.  This is what its counterpart entity_addr_t::is_blank_ip() is
doing and it is the right thing to do: in process_banner() we check if
our address is blank and if it is "learn" it from our peer.  As it is,
we never learn our address and always send out a blank one.  This goes
way back to ceph.git commit dd732cbfc1c9 ("use sockaddr_storage; and
some ipv6 support groundwork") from 2009.

While at at, do not open-code ipv6_addr_any() and use INADDR_ANY
constant instead of 0.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Sage Weil <sage@redhat.com>
net/ceph/messenger.c