The static analyzer of clang claims that the left operand of the condition
ss->ss_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&ia6->sin6_addr);
in SS_IS_ADDR_V4MAPPED() is a garbage value. The code has been like
this for seven years without problems, so the warning is probably
bogus.
It does not hurt to initialize the sockaddr_storage structures though,
which silences the warning.
*/
int generic_max_transport_msg_size(int sockfd)
{
- struct sockaddr_storage ss;
+ struct sockaddr_storage ss = {0};
socklen_t sslen = sizeof(ss);
int af_type = AF_INET;
*/
char *remote_name(int fd)
{
- struct sockaddr_storage ss;
+ struct sockaddr_storage ss = {0};
const struct sockaddr *sa;
socklen_t sslen = sizeof(ss);
char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];