summaryrefslogtreecommitdiff
path: root/src/network/networkd-network.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-07-16 13:17:10 +0200
committerTom Gundersen <teg@jklm.no>2014-07-21 13:32:27 +0200
commitaa9f11405829fd4755fef28602a7167dba3ddc89 (patch)
treef86bcda9b90b0e72b1f1e7ffe3f50e9c5d736612 /src/network/networkd-network.c
parent653912918f594ebbca46806b302ef6b477402575 (diff)
networkd: netdev - split NetDev struct into per-kind structs
Similarly to how unit types work.
Diffstat (limited to 'src/network/networkd-network.c')
-rw-r--r--src/network/networkd-network.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index 3e46a1a80e..bc9304291e 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -66,11 +66,11 @@ static int network_load_one(Manager *manager, const char *filename) {
if (!network->vlans)
return log_oom();
- network->macvlans = hashmap_new(uint64_hash_func, uint64_compare_func);
+ network->macvlans = hashmap_new(string_hash_func, string_compare_func);
if (!network->macvlans)
return log_oom();
- network->vxlans = hashmap_new(uint64_hash_func, uint64_compare_func);
+ network->vxlans = hashmap_new(string_hash_func, string_compare_func);
if (!network->vxlans)
return log_oom();
@@ -323,10 +323,11 @@ int config_parse_netdev(const char *unit,
break;
case NETDEV_KIND_VLAN:
- r = hashmap_put(network->vlans, &netdev->vlanid, netdev);
+ r = hashmap_put(network->vlans, netdev->ifname, netdev);
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, EINVAL,
- "Can not add VLAN to network: %s", rvalue);
+ "Can not add VLAN '%s' to network: %s",
+ rvalue, strerror(-r));
return 0;
}
@@ -335,7 +336,8 @@ int config_parse_netdev(const char *unit,
r = hashmap_put(network->macvlans, netdev->ifname, netdev);
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, EINVAL,
- "Can not add MACVLAN to network: %s", rvalue);
+ "Can not add MACVLAN '%s' to network: %s",
+ rvalue, strerror(-r));
return 0;
}
@@ -344,7 +346,8 @@ int config_parse_netdev(const char *unit,
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);
+ "Can not add VXLAN '%s' to network: %s",
+ rvalue, strerror(-r));
return 0;
}