diff options
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.patch | 47 |
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 @@ | |||
1 | From 6e3dd61bf90a7ca8c36c5b95943cbff7c1ad3c2d Mon Sep 17 00:00:00 2001 | ||
2 | From: Yi Zhao <yi.zhao@windriver.com> | ||
3 | Date: Wed, 6 Mar 2024 16:12:31 +0800 | ||
4 | Subject: [PATCH] networkd.c: define scope specific to case statement | ||
5 | |||
6 | Per [1], define a scope specific to case statement to fix build with | ||
7 | clang. | ||
8 | |||
9 | Fixes: | ||
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 | |||
19 | Upstream-Status: Pending | ||
20 | |||
21 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
22 | --- | ||
23 | src/networkd.c | 2 ++ | ||
24 | 1 file changed, 2 insertions(+) | ||
25 | |||
26 | diff --git a/src/networkd.c b/src/networkd.c | ||
27 | index 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 | -- | ||
46 | 2.25.1 | ||
47 | |||