mirror of
https://github.com/samba-team/samba.git
synced 2025-08-07 09:49:30 +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 used to be commit 2827bbe0f8
)
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
b5535567c1
commit
f7055aef17
@ -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;
|
||||
|
Reference in New Issue
Block a user