1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-21 01:59:07 +03:00

r25565: Fix unintended consequence change for IPv6 noticed

by Volker. We used to return 0.0.0.0 for the text
address of an uninitialized socket - ensure we
still do so. Once uninitialized address is as
good as any other.
Jeremy.
This commit is contained in:
Jeremy Allison 2007-10-08 02:48:03 +00:00 committed by Gerald (Jerry) Carter
parent d100bfffe2
commit 2827bbe0f8

View File

@ -70,7 +70,12 @@ static char *get_socket_addr(int fd)
socklen_t length = sizeof(sa);
static char addr_buf[INET6_ADDRSTRLEN];
addr_buf[0] = '\0';
/* Ok, returning a hard coded IPv4 address
* is bogus, but it's just as bogus as a
* zero IPv6 address. No good choice here.
*/
safe_strcpy(addr_buf, "0.0.0.0", sizeof(addr_buf)-1);
if (fd == -1) {
return addr_buf;