diff options
author | Susant Sahani <ssahani@redhat.com> | 2016-04-25 12:37:10 +0530 |
---|---|---|
committer | Susant Sahani <ssahani@redhat.com> | 2016-04-25 12:37:10 +0530 |
commit | cacc1dbf17e839a8a10ee3c43c2bb2bf8bda7642 (patch) | |
tree | 3a55e61b6f04d88c6c5d71ba4b11ecacb551be9e /src/network/networkd-route.c | |
parent | 4f4d6ee4be1c5d3bb2f3ebce7d2d332285963830 (diff) |
networkd: Fix route properties.
We are not able to add multiple properties.
wlp3s0.network:
[Match]
Name=wlp3s0
[Route]
Gateway=10.68.5.26
Metric=10
sudo ./systemd-networkd
Failed to parse file '/usr/lib/systemd/network/wlp3s0.network': File
exists
Could not load configuration files: File exists
This patch fixes it.
Diffstat (limited to 'src/network/networkd-route.c')
-rw-r--r-- | src/network/networkd-route.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index ab9b777d9a..bda2707e6d 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -68,15 +68,15 @@ int route_new_static(Network *network, unsigned section, Route **ret) { route->protocol = RTPROT_STATIC; if (section) { + route->section = section; + r = hashmap_put(network->routes_by_section, UINT_TO_PTR(route->section), route); if (r < 0) return r; - - route->section = section; } - LIST_PREPEND(routes, network->static_routes, route); route->network = network; + LIST_PREPEND(routes, network->static_routes, route); *ret = route; route = NULL; |