From f4859fc74c06bf5040e96ef68ddf7102f43cc7db Mon Sep 17 00:00:00 2001 From: Susant Sahani Date: Wed, 15 Feb 2017 10:00:35 +0530 Subject: networkd: fix drop-in conf directory configs overwriting each other Now we track the sections for example [Address] via line number. Which was fine till we din't had dropins dir. If we have multiple sections which have the ideantical line number in diffrent files we are overwriting these since line number is the key. This patch fixes this by taking filename and line number as key. This fixes [Address] and [Route] section overwriting. fixes: #5141 --- src/network/networkd-route.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/network/networkd-route.h') diff --git a/src/network/networkd-route.h b/src/network/networkd-route.h index 02f0b27675..4ebfa0f0bd 100644 --- a/src/network/networkd-route.h +++ b/src/network/networkd-route.h @@ -20,12 +20,13 @@ ***/ typedef struct Route Route; +typedef struct NetworkConfigSection NetworkConfigSection; #include "networkd-network.h" struct Route { Network *network; - unsigned section; + NetworkConfigSection *section; Link *link; @@ -52,7 +53,7 @@ struct Route { LIST_FIELDS(Route, routes); }; -int route_new_static(Network *network, unsigned section, Route **ret); +int route_new_static(Network *network, const char *filename, unsigned section_line, Route **ret); int route_new(Route **ret); void route_free(Route *route); int route_configure(Route *route, Link *link, sd_netlink_message_handler_t callback); -- cgit v1.2.3-54-g00ecf