summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-route.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-11-12 06:55:52 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-11-12 08:32:10 +0100
commit17f9c355d578e355cceb57786ca13288501729fd (patch)
tree39bd5559e2a87b5d7c453b77fd9d8a3955050050 /src/network/networkd-route.c
parentnetwork: use NetworkConfigSection in fdb entries (diff)
downloadsystemd-17f9c355d578e355cceb57786ca13288501729fd.tar.xz
systemd-17f9c355d578e355cceb57786ca13288501729fd.zip
network: use structured initializers
Diffstat (limited to 'src/network/networkd-route.c')
-rw-r--r--src/network/networkd-route.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
index e8cde66bef..63126b4d13 100644
--- a/src/network/networkd-route.c
+++ b/src/network/networkd-route.c
@@ -46,17 +46,19 @@ static unsigned routes_max(void) {
int route_new(Route **ret) {
_cleanup_(route_freep) Route *route = NULL;
- route = new0(Route, 1);
+ route = new(Route, 1);
if (!route)
return -ENOMEM;
- route->family = AF_UNSPEC;
- route->scope = RT_SCOPE_UNIVERSE;
- route->protocol = RTPROT_UNSPEC;
- route->type = RTN_UNICAST;
- route->table = RT_TABLE_MAIN;
- route->lifetime = USEC_INFINITY;
- route->quickack = -1;
+ *route = (Route) {
+ .family = AF_UNSPEC,
+ .scope = RT_SCOPE_UNIVERSE,
+ .protocol = RTPROT_UNSPEC,
+ .type = RTN_UNICAST,
+ .table = RT_TABLE_MAIN,
+ .lifetime = USEC_INFINITY,
+ .quickack = -1,
+ };
*ret = TAKE_PTR(route);