diff options
author | Susant Sahani <susant@redhat.com> | 2014-06-16 11:54:33 +0530 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-06-16 20:38:22 +0200 |
commit | 326cb4061a7d6ec4107f298b6f947d645512ad76 (patch) | |
tree | 3508a9288e03c4cc7a5d882b9de7748781b16b9b /src/network/networkd-network.c | |
parent | 1324e3ae515719a93a94a8d8316644af6c780909 (diff) |
networkd: introduce vxlan
This patch enables netwokd to create vxlan
Changes:
Added:
1. File networkd networkd-vxlan.c
2. to netdev
bool learning
struct in_addr group
uint64_t vxlanid;
3. VXLAN subsection and config
parameters
Diffstat (limited to 'src/network/networkd-network.c')
-rw-r--r-- | src/network/networkd-network.c | 17 |
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"); } |