diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/interfaces.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/lib/interfaces.c b/source3/lib/interfaces.c index bc6c991f6f..b4b380000a 100644 --- a/source3/lib/interfaces.c +++ b/source3/lib/interfaces.c @@ -156,10 +156,6 @@ static int _get_interfaces(TALLOC_CTX *mem_ctx, struct iface_struct **pifaces) /* Loop through interfaces, looking for given IP address */ for (ifptr = iflist; ifptr != NULL; ifptr = ifptr->ifa_next) { - memset(&ifaces[total], '\0', sizeof(ifaces[total])); - - copy_size = sizeof(struct sockaddr_in); - if (!ifptr->ifa_addr || !ifptr->ifa_netmask) { continue; } @@ -169,6 +165,10 @@ static int _get_interfaces(TALLOC_CTX *mem_ctx, struct iface_struct **pifaces) continue; } + memset(&ifaces[total], '\0', sizeof(ifaces[total])); + + copy_size = sizeof(struct sockaddr_in); + ifaces[total].flags = ifptr->ifa_flags; #if defined(HAVE_IPV6) |