chiark / gitweb /
journal-remote: rework fd and writer reference handling
[elogind.git] / src / network / networkd-route.c
index d0a04ecfeebcd3388469cda35e22e083101c7b5d..8949299409f476aead74fca52037049b309a60fd 100644 (file)
@@ -164,6 +164,8 @@ int route_drop(Route *route, Link *link,
                 return r;
         }
 
+        link_ref(link);
+
         return 0;
 }
 
@@ -235,6 +237,8 @@ int route_configure(Route *route, Link *link,
                 return r;
         }
 
+        link_ref(link);
+
         return 0;
 }
 
@@ -356,3 +360,38 @@ int config_parse_destination(const char *unit,
 
         return 0;
 }
+
+int config_parse_route_priority(const char *unit,
+                                const char *filename,
+                                unsigned line,
+                                const char *section,
+                                unsigned section_line,
+                                const char *lvalue,
+                                int ltype,
+                                const char *rvalue,
+                                void *data,
+                                void *userdata) {
+        Network *network = userdata;
+        _cleanup_route_free_ Route *n = NULL;
+        int r;
+
+        assert(filename);
+        assert(section);
+        assert(lvalue);
+        assert(rvalue);
+        assert(data);
+
+        r = route_new_static(network, section_line, &n);
+        if (r < 0)
+                return r;
+
+        r = config_parse_unsigned(unit, filename, line, section,
+                                  section_line, lvalue, ltype,
+                                  rvalue, &n->metrics, userdata);
+        if (r < 0)
+                return r;
+
+        n = NULL;
+
+        return 0;
+}