resolved: also disable stub listener on EPERM
When running in a user namespace without private networking, resolved would fail to start. There isn't much difference between EADDRINUSE and EPERM, so treat them the same, except for the warning message text.
This commit is contained in:
@@ -511,9 +511,15 @@ int manager_dns_stub_start(Manager *m) {
|
||||
r = manager_dns_stub_tcp_fd(m);
|
||||
}
|
||||
|
||||
if (r == -EADDRINUSE) {
|
||||
log_warning("Another process is already listening on %s socket 127.0.0.53:53.\n"
|
||||
"Turning off local DNS stub support.", t);
|
||||
if (IN_SET(r, -EADDRINUSE, -EPERM)) {
|
||||
if (r == -EADDRINUSE)
|
||||
log_warning_errno(r,
|
||||
"Another process is already listening on %s socket 127.0.0.53:53.\n"
|
||||
"Turning off local DNS stub support.", t);
|
||||
else
|
||||
log_warning_errno(r,
|
||||
"Failed to listen on %s socket 127.0.0.53:53: %m.\n"
|
||||
"Turning off local DNS stub support.", t);
|
||||
manager_dns_stub_stop(m);
|
||||
} else if (r < 0)
|
||||
return log_error_errno(r, "Failed to listen on %s socket 127.0.0.53:53: %m", t);
|
||||
|
||||
Reference in New Issue
Block a user