summaryrefslogtreecommitdiff
path: root/src/network/networkd-network.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-02-08 22:27:15 +0100
committerTom Gundersen <teg@jklm.no>2015-02-09 12:20:10 +0100
commitd0d6a4cd70477970812bff0a37e70f66208d7c14 (patch)
treed0cf5c3ff73e39e5057d7ed81e6e49c5732b70e0 /src/network/networkd-network.c
parent73cb1c149dc05abef5ad2814d6193cc33a991082 (diff)
downloadsystemd-d0d6a4cd70477970812bff0a37e70f66208d7c14.tar.gz
networkd: generalize IPv4LL to LinkLocal
This allows both IPv4 and IPv6 link-local addresses to be enabled or disabled. By default we still enable IPv6LL and disable IPv4LL. The old config option is kept for backwards compatibility, but removed from the documentation.
Diffstat (limited to 'src/network/networkd-network.c')
-rw-r--r--src/network/networkd-network.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index 504419cdb0..c39ba6dfa2 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -107,6 +107,8 @@ static int network_load_one(Manager *manager, const char *filename) {
network->llmnr = LLMNR_SUPPORT_YES;
+ network->link_local = ADDRESS_FAMILY_IPV6;
+
r = config_parse(NULL, filename, file,
"Match\0"
"Link\0"
@@ -520,6 +522,37 @@ int config_parse_tunnel(const char *unit,
return 0;
}
+int config_parse_ipv4ll(
+ const char* unit,
+ const char *filename,
+ unsigned line,
+ const char *section,
+ unsigned section_line,
+ const char *lvalue,
+ int ltype,
+ const char *rvalue,
+ void *data,
+ void *userdata) {
+
+ AddressFamilyBoolean *link_local = data;
+
+ assert(filename);
+ assert(lvalue);
+ assert(rvalue);
+ assert(data);
+
+ /* Note that this is mostly like
+ * config_parse_address_family_boolean(), except that it
+ * applies only to IPv4 */
+
+ if (parse_boolean(rvalue))
+ *link_local |= ADDRESS_FAMILY_IPV4;
+ else
+ *link_local &= ~ADDRESS_FAMILY_IPV4;
+
+ return 0;
+}
+
int config_parse_dhcp(
const char* unit,
const char *filename,