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-network.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/network/networkd-network.h') diff --git a/src/network/networkd-network.h b/src/network/networkd-network.h index f06828a899..4ce066a764 100644 --- a/src/network/networkd-network.h +++ b/src/network/networkd-network.h @@ -82,6 +82,17 @@ typedef struct DUID { uint8_t raw_data[MAX_DUID_LEN]; } DUID; +typedef struct NetworkConfigSection { + unsigned line; + char filename[]; +} NetworkConfigSection; + +int network_config_section_new(const char *filename, unsigned line, NetworkConfigSection **s); +void network_config_section_free(NetworkConfigSection *network); + +DEFINE_TRIVIAL_CLEANUP_FUNC(NetworkConfigSection*, network_config_section_free); +#define _cleanup_network_config_section_free_ _cleanup_(network_config_section_freep) + typedef struct Manager Manager; struct Network { -- cgit v1.2.3-54-g00ecf