summaryrefslogtreecommitdiff
path: root/src/test/test-nss-hosts.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-03-26 18:11:41 +0100
committerLennart Poettering <lennart@poettering.net>2021-04-23 12:02:11 +0200
commita1fdbcbe3d0ab58ac274f5a6a0669752d5b4238b (patch)
tree3d0310e615a8f7ee185646092f6cbc2ac2333b1f /src/test/test-nss-hosts.c
parent54e6f97bc9931679aa9b895546621b15e0f464a4 (diff)
downloadsystemd-a1fdbcbe3d0ab58ac274f5a6a0669752d5b4238b.tar.gz
nss-myhostname: expose the "outbound" IP addresses under the synthetic "_outbound" hostname
I found myself often looking for a quick way to determine "the local IP address", and then being lost in the "ip addr" output to find for the right one to use. This is supposed to help a bit with that. Let's introduce a new special hostname "_outbound" with semantics similar to "_gateway" that resolves to addresses that are the closest I could come up with that maps to "the" local IP address.
Diffstat (limited to 'src/test/test-nss-hosts.c')
-rw-r--r--src/test/test-nss-hosts.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/test/test-nss-hosts.c b/src/test/test-nss-hosts.c
index e9bc6ecce6..42ed53adc3 100644
--- a/src/test/test-nss-hosts.c
+++ b/src/test/test-nss-hosts.c
@@ -455,8 +455,7 @@ static int parse_argv(int argc, char **argv,
} else {
_cleanup_free_ char *hostname;
assert_se(hostname = gethostname_malloc());
-
- assert_se(names = strv_new("localhost", "_gateway", "foo_no_such_host", hostname));
+ assert_se(names = strv_new("localhost", "_gateway", "_outbound", "foo_no_such_host", hostname));
n = make_addresses(&addrs);
assert_se(n >= 0);