We should keep the unused parts of u zeroed.
Signed-off-by: Sage Weil <sage@redhat.com>
{
switch (sa->sa_family) {
case AF_INET:
+ // pre-zero, since we're only copying a portion of the source
+ memset(&u, 0, sizeof(u));
memcpy(&u.sin, sa, sizeof(u.sin));
break;
case AF_INET6:
+ // pre-zero, since we're only copying a portion of the source
+ memset(&u, 0, sizeof(u));
memcpy(&u.sin6, sa, sizeof(u.sin6));
break;
default: