diff options
author | Tom Gundersen <teg@jklm.no> | 2015-10-09 23:43:52 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-10-21 03:24:23 +0200 |
commit | ed9e361a8a798f9fee353b5c7e0e23308e0d329f (patch) | |
tree | 7364a91ea53be278359af58c8b002d8c3e3d0cd9 /src/network/networkd-route.c | |
parent | adda1ed94a04742ddacdc76dfa311816e1ed9f68 (diff) |
networkd: route - simplify route_new()
Diffstat (limited to 'src/network/networkd-route.c')
-rw-r--r-- | src/network/networkd-route.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 1c8302ffaa..66b165f661 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -26,7 +26,7 @@ #include "networkd.h" #include "networkd-route.h" -int route_new(Route **ret, unsigned char rtm_protocol) { +int route_new(Route **ret) { _cleanup_route_free_ Route *route = NULL; route = new0(Route, 1); @@ -35,7 +35,7 @@ int route_new(Route **ret, unsigned char rtm_protocol) { route->family = AF_UNSPEC; route->scope = RT_SCOPE_UNIVERSE; - route->protocol = rtm_protocol; + route->protocol = RTPROT_UNSPEC; *ret = route; route = NULL; @@ -58,10 +58,11 @@ int route_new_static(Network *network, unsigned section, Route **ret) { } } - r = route_new(&route, RTPROT_STATIC); + r = route_new(&route); if (r < 0) return r; + route->protocol = RTPROT_STATIC; route->network = network; LIST_PREPEND(routes, network->static_routes, route); |