summaryrefslogtreecommitdiff
path: root/src/network/networkd-network.h
diff options
context:
space:
mode:
authorSusant Sahani <susant@redhat.com>2017-02-15 10:00:35 +0530
committerSusant Sahani <susant@redhat.com>2017-02-16 10:31:42 +0530
commitf4859fc74c06bf5040e96ef68ddf7102f43cc7db (patch)
treee827c6ba57a292e1c77b3e4e07f585152e948dc6 /src/network/networkd-network.h
parent28b1a3eac252d471de4fbb6f317353af30d68878 (diff)
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
Diffstat (limited to 'src/network/networkd-network.h')
-rw-r--r--src/network/networkd-network.h11
1 files changed, 11 insertions, 0 deletions
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 {