summaryrefslogtreecommitdiffstats
path: root/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0001-networkd.c-define-scope-specific-to-case-statement.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0001-networkd.c-define-scope-specific-to-case-statement.patch')
-rw-r--r--meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0001-networkd.c-define-scope-specific-to-case-statement.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0001-networkd.c-define-scope-specific-to-case-statement.patch b/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0001-networkd.c-define-scope-specific-to-case-statement.patch
new file mode 100644
index 000000000..9f01108a2
--- /dev/null
+++ b/meta-oe/dynamic-layers/meta-python/recipes-connectivity/netplan/netplan/0001-networkd.c-define-scope-specific-to-case-statement.patch
@@ -0,0 +1,47 @@
1From 6e3dd61bf90a7ca8c36c5b95943cbff7c1ad3c2d Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Wed, 6 Mar 2024 16:12:31 +0800
4Subject: [PATCH] networkd.c: define scope specific to case statement
5
6Per [1], define a scope specific to case statement to fix build with
7clang.
8
9Fixes:
10../git/src/networkd.c:544:13: error: expected expression
11 544 | gchar* first = g_strcmp0(def->id, def->veth_peer_link->id) < 0 ? def->id : def->veth_peer_link->id;
12 | ^
13../git/src/networkd.c:545:17: error: use of undeclared identifier 'first'
14 545 | if (first != def->id) {
15 | ^
16
17[1] https://stackoverflow.com/questions/92396/why-cant-variables-be-declared-in-a-switch-statement
18
19Upstream-Status: Pending
20
21Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
22---
23 src/networkd.c | 2 ++
24 1 file changed, 2 insertions(+)
25
26diff --git a/src/networkd.c b/src/networkd.c
27index 25121c48..5eb9c0fe 100644
28--- a/src/networkd.c
29+++ b/src/networkd.c
30@@ -541,12 +541,14 @@ write_netdev_file(const NetplanNetDefinition* def, const char* rootdir, const ch
31 * and, if the selected name is the name of the netdef being written, we generate
32 * the .netdev file. Otherwise we skip the netdef.
33 */
34+ {
35 gchar* first = g_strcmp0(def->id, def->veth_peer_link->id) < 0 ? def->id : def->veth_peer_link->id;
36 if (first != def->id) {
37 g_string_free(s, TRUE);
38 return;
39 }
40 g_string_append_printf(s, "Kind=veth\n\n[Peer]\nName=%s\n", def->veth_peer_link->id);
41+ }
42 break;
43
44 case NETPLAN_DEF_TYPE_TUNNEL:
45--
462.25.1
47