Skip to contentSkip to conversation

netplan: Fix a warning with clang

PATCH New Khem Raj 1 participant 1 message Jun 8, 2021

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 netplan: Fix a warning with clang

Refresh musl patch to avoid fuzz

Cc Zang Ruochen <[email protected]>
---
 .../0001-Handle-enum-element-override.patch   | 34 +++++++++++++++++++
 ...-t-fail-if-GLOB_BRACE-is-not-defined.patch |  9 ++---
 .../netplan/netplan_0.102.bb                  |  1 +
 3 files changed, 37 insertions(+), 7 deletions(-)
 create mode 100644 meta-networking/recipes-connectivity/netplan/netplan/0001-Handle-enum-element-override.patch
meta-networking/recipes-connectivity/netplan/netplan/0001-Handle-enum-element-override.patch new file +34 -0
new file mode 100644
index 0000000000..dfc6f90c4c
@@ -0,0 +1,34 @@
+From 6d284f1ff81494a5fca91a399b92b218ea1a9ea8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 8 Jun 2021 08:53:30 -0700
+Subject: [PATCH] Handle enum element override
+
+NETPLAN_DEF_TYPE_VIRTUAL and NETPLAN_DEF_TYPE_BRIDGE point
+to same value in enum, however here they are assigned individually
+which results in overriding the initialization of the objects
+
+Fixes
+src/netplan.h:85:33: error: initializer overrides prior initialization of this subobject [-Werror,-Winitializer-overrides]
+    [NETPLAN_DEF_TYPE_BRIDGE] = "bridges",
+                                ^~~~~~~~~
+Upstream-Status: Submitted [https://github.com/canonical/netplan/pull/213]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/netplan.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/netplan.h b/src/netplan.h
+index d2c538b..26574f8 100644
+--- a/src/netplan.h
++++ b/src/netplan.h
+@@ -81,7 +81,6 @@ static const char* const netplan_def_type_to_str[NETPLAN_DEF_TYPE_MAX_] = {
+     [NETPLAN_DEF_TYPE_ETHERNET] = "ethernets",
+     [NETPLAN_DEF_TYPE_WIFI] = "wifis",
+     [NETPLAN_DEF_TYPE_MODEM] = "modems",
+-    [NETPLAN_DEF_TYPE_VIRTUAL] = NULL,
+     [NETPLAN_DEF_TYPE_BRIDGE] = "bridges",
+     [NETPLAN_DEF_TYPE_BOND] = "bonds",
+     [NETPLAN_DEF_TYPE_VLAN] = "vlans",
+-- 
+2.32.0
+
meta-networking/recipes-connectivity/netplan/netplan/0001-don-t-fail-if-GLOB_BRACE-is-not-defined.patch +2 -7
index dab8693c71..0fa6ba48a4 100644
@@ -8,13 +8,11 @@ Signed-off-by: Zang Ruochen <[email protected]>
  src/util.c | 6 ++++++
  1 file changed, 6 insertions(+)
 
-diff --git a/src/util.c b/src/util.c
-index 7e59985..eb8e573 100644
 --- a/src/util.c
 +++ b/src/util.c
-@@ -23,6 +23,12 @@
- 
+@@ -24,6 +24,12 @@
  #include "util.h"
+ #include "netplan.h"
  
 +/* Don't fail if the standard library
 + * doesn't provide brace expansion */
@@ -25,6 +23,3 @@ index 7e59985..eb8e573 100644
  GHashTable* wifi_frequency_24;
  GHashTable* wifi_frequency_5;
  
--- 
-2.25.1
-
meta-networking/recipes-connectivity/netplan/netplan_0.102.bb +1 -0
index 81b58ab904..3328dfbbb9 100644
@@ -16,6 +16,7 @@ PV = "0.102+git${SRCPV}"
 
 SRC_URI = " \
         git://github.com/CanonicalLtd/netplan.git \
+        file://0001-Handle-enum-element-override.patch \
 "
 SRC_URI_append_libc-musl = " file://0001-don-t-fail-if-GLOB_BRACE-is-not-defined.patch"
 
Signature · 1 line
2.32.0