############################################################
conf.set_quoted('FALLBACK_HOSTNAME', get_option('fallback-hostname'))
+conf.set10('ENABLE_COMPAT_GATEWAY_HOSTNAME', get_option('compat-gateway-hostname'))
+gateway_hostnames = ['_gateway'] + (conf.get('ENABLE_COMPAT_GATEWAY_HOSTNAME') == 1 ? ['gateway'] : [])
default_hierarchy = get_option('default-hierarchy')
conf.set_quoted('DEFAULT_HIERARCHY_NAME', default_hierarchy,
'nobody user name: @0@'.format(get_option('nobody-user')),
'nobody group name: @0@'.format(get_option('nobody-group')),
'fallback hostname: @0@'.format(get_option('fallback-hostname')),
+ 'symbolic gateway hostnames: @0@'.format(', '.join(gateway_hostnames)),
'default DNSSEC mode: @0@'.format(default_dnssec),
'default cgroup hierarchy: @0@'.format(default_hierarchy),
option('fallback-hostname', type : 'string', value : 'localhost',
description : 'the hostname used if none configured')
+option('compat-gateway-hostname', type : 'boolean', value : 'false',
+ description : 'allow "gateway" as the symbolic name for default gateway')
option('default-hierarchy', type : 'combo',
choices : ['legacy', 'hybrid', 'unified'], value : 'hybrid',
description : 'default cgroup hierarchy')
* synthetic "gateway" host. */
return
- strcaseeq(hostname, "gateway") ||
- strcaseeq(hostname, "gateway.");
+ strcaseeq(hostname, "_gateway") || strcaseeq(hostname, "_gateway.")
+#if ENABLE_COMPAT_GATEWAY_HOSTNAME
+ || strcaseeq(hostname, "gateway") || strcaseeq(hostname, "gateway.")
+#endif
+ ;
}
int sethostname_idempotent(const char *s) {
return NSS_STATUS_NOTFOUND;
}
- canonical = "gateway";
+ canonical = "_gateway";
} else {
hn = gethostname_malloc();
return NSS_STATUS_NOTFOUND;
}
- canonical = "gateway";
+ canonical = "_gateway";
} else {
hn = gethostname_malloc();
continue;
if (memcmp(addr, &a->address, FAMILY_ADDRESS_SIZE(af)) == 0) {
- canonical = "gateway";
+ canonical = "_gateway";
goto found;
}
}
if (n < 0)
return n;
- return answer_add_addresses_ptr(answer, "gateway", addresses, n, af, address);
+ return answer_add_addresses_ptr(answer, "_gateway", addresses, n, af, address);
}
int dns_synthesize_answer(
if (!hostname)
return -ENOMEM;
- names = strv_new("localhost", "gateway", "foo_no_such_host", hostname, NULL);
+ names = strv_new("localhost", "_gateway", "foo_no_such_host", hostname, NULL);
if (!names)
return -ENOMEM;