mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Fix namebuff overwrite leading to wrong log after socket bind warning.
This commit is contained in:
@@ -2439,12 +2439,12 @@ static int random_sock(struct server *s)
|
||||
return fd;
|
||||
|
||||
if (s->interface[0] == 0)
|
||||
(void)prettyprint_addr(&s->source_addr, daemon->namebuff);
|
||||
(void)prettyprint_addr(&s->source_addr, daemon->addrbuff);
|
||||
else
|
||||
strcpy(daemon->namebuff, s->interface);
|
||||
safe_strncpy(daemon->addrbuff, s->interface, ADDRSTRLEN);
|
||||
|
||||
my_syslog(LOG_ERR, _("failed to bind server socket to %s: %s"),
|
||||
daemon->namebuff, strerror(errno));
|
||||
daemon->addrbuff, strerror(errno));
|
||||
close(fd);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user