]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: route - use ordered_set_ensure_put
authorSusant Sahani <ssahani@vmware.com>
Thu, 14 Jan 2021 11:58:58 +0000 (12:58 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sat, 16 Jan 2021 12:05:44 +0000 (12:05 +0000)
src/network/networkd-route.c

index d23d74d5c8b4dbe86f3535cbf3c0e375cdf8293e..52de09245ba97352661559ffcc2326569f915e84 100644 (file)
@@ -2341,11 +2341,9 @@ int config_parse_multipath_route(
                 }
         }
 
-        r = ordered_set_ensure_allocated(&n->multipath_routes, NULL);
-        if (r < 0)
+        r = ordered_set_ensure_put(&n->multipath_routes, NULL, m);
+        if (r == -ENOMEM)
                 return log_oom();
-
-        r = ordered_set_put(n->multipath_routes, m);
         if (r < 0) {
                 log_syntax(unit, LOG_WARNING, filename, line, r,
                            "Failed to store multipath route, ignoring assignment: %m");