From d0e5db44d9e1cf61ca75c8a86ffed19cc1b7fe5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 15 Sep 2020 14:49:36 +0200 Subject: [PATCH] sd-bus: allow localhost addresses By settings AI_ADDRCONFIG in hints we cannot for example resolve "localhost" when the local machine only has a loopback interface. This seems like an unnecessary restriction, drop it. Inspired by https://bugzilla.redhat.com/show_bug.cgi?id=1839007. --- TODO | 3 +++ src/libsystemd/sd-bus/sd-bus.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 69c05d3d38..76cc74f340 100644 --- a/TODO +++ b/TODO @@ -561,6 +561,9 @@ Features: * sd-bus: add vtable flag, that may be used to request client creds implicitly and asynchronously before dispatching the operation +* sd-bus: parse addresses given in sd_bus_set_addresses immediately and not + only when used. Add unit tests. + * make use of ethtool veth peer info in machined, for automatically finding out host-side interface pointing to the container. diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index 272b97e17a..015a215c42 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c @@ -782,7 +782,6 @@ static int parse_tcp_address(sd_bus *b, const char **p, char **guid) { int r; struct addrinfo *result, hints = { .ai_socktype = SOCK_STREAM, - .ai_flags = AI_ADDRCONFIG, }; assert(b);