Merge pull request #19134 from poettering/outbound-special-hostname

introduce a new synthetic hostname "_outbound" that maps to "the" local IP address
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-05-07 17:15:22 +02:00
committed by GitHub
11 changed files with 262 additions and 18 deletions
+7
View File
@@ -40,5 +40,12 @@ int main(int argc, char *argv[]) {
print_local_addresses(a, (unsigned) n);
free(a);
n = local_outbounds(NULL, 0, AF_UNSPEC, &a);
assert_se(n >= 0);
printf("Local Outbounds:\n");
print_local_addresses(a, (unsigned) n);
free(a);
return 0;
}
+1 -2
View File
@@ -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);