monitor creation with IPv6 public network segfaults
steps to reproduce:
1.) setup host using IPv6
2.) configure cluster and public network with IPv6 subnets in ceph.conf
3.) attempt to create a monitor
4.) ceph-mon --mkfs ... segfaults
the problematic code has been commited in 2011 before v0.39 - I haven't actually verified whether it is triggered that far back. it definitely triggers a segfault on Ceph Luminous (12.0.0)
the root cause is declaring a "struct sockaddr" in src/common/pick_address.cc find_ip_in_subnet_list, which is then first passed to parse_network and then to find_ip_in_subnet (both in src/common/ipaddr.cc). find_ip_in_subnet then casts the reference to sockaddr to one to sockaddr_in6 and assigns the IPv6 address. unfortunately, sockaddr is only 16 bytes big, so this assignment overwrites stuff on the stack.
note that the test cases don't catch this, as they only pass bigger structs casted to (sockaddr *) to parse_networks and find_ip_in_subnet when testing IPv6.
pull request will follow