summaryrefslogtreecommitdiff
path: root/src/network/networkd-network.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-network.c')
-rw-r--r--src/network/networkd-network.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index 4e38173140..45c1ab0f4c 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -69,6 +69,10 @@ static int network_load_one(Manager *manager, const char *filename) {
if (!network->macvlans)
return log_oom();
+ network->vxlans = hashmap_new(uint64_hash_func, uint64_compare_func);
+ if (!network->vxlans)
+ return log_oom();
+
network->addresses_by_section = hashmap_new(uint64_hash_func, uint64_compare_func);
if (!network->addresses_by_section)
return log_oom();
@@ -183,6 +187,10 @@ void network_free(Network *network) {
netdev_unref(netdev);
hashmap_free(network->macvlans);
+ HASHMAP_FOREACH(netdev, network->vxlans, i)
+ netdev_unref(netdev);
+ hashmap_free(network->vxlans);
+
while ((route = network->static_routes))
route_free(route);
@@ -326,6 +334,15 @@ int config_parse_netdev(const char *unit,
}
break;
+ case NETDEV_KIND_VXLAN:
+ r = hashmap_put(network->vxlans, netdev->ifname, netdev);
+ if (r < 0) {
+ log_syntax(unit, LOG_ERR, filename, line, EINVAL,
+ "Can not add VXLAN to network: %s", rvalue);
+ return 0;
+ }
+
+ break;
default:
assert_not_reached("Can not parse NetDev");
}