diff options
Diffstat (limited to 'meta/recipes-core/systemd/systemd/network-also-drop-requests-when-link-enters-linger-state.patch')
-rw-r--r-- | meta/recipes-core/systemd/systemd/network-also-drop-requests-when-link-enters-linger-state.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/network-also-drop-requests-when-link-enters-linger-state.patch b/meta/recipes-core/systemd/systemd/network-also-drop-requests-when-link-enters-linger-state.patch new file mode 100644 index 0000000000..4c402e7e55 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/network-also-drop-requests-when-link-enters-linger-state.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From 56001f023305ea99329e27141d6e6067596491a9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Yu Watanabe <watanabe.yu+github@gmail.com> | ||
3 | Date: Mon, 17 May 2021 15:32:57 +0900 | ||
4 | Subject: [PATCH] network: also drop requests when link enters linger state | ||
5 | |||
6 | Otherwise, if link is removed, several references to the link in remain | ||
7 | exist in requests. | ||
8 | |||
9 | Upstream-Status: Backport [https://github.com/systemd/systemd-stable/commit/56001f023305ea99329e27141d6e6067596491a9] | ||
10 | Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com> | ||
11 | |||
12 | --- | ||
13 | src/network/networkd-link.c | 24 +++++++++++++----------- | ||
14 | 1 file changed, 13 insertions(+), 11 deletions(-) | ||
15 | |||
16 | diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c | ||
17 | index 67d01ac44d..b56c232eca 100644 | ||
18 | --- a/src/network/networkd-link.c | ||
19 | +++ b/src/network/networkd-link.c | ||
20 | @@ -1771,6 +1771,18 @@ static void link_drop_from_master(Link *link, NetDev *netdev) { | ||
21 | link_unref(set_remove(master->slaves, link)); | ||
22 | } | ||
23 | |||
24 | +static void link_drop_requests(Link *link) { | ||
25 | + Request *req; | ||
26 | + Iterator i; | ||
27 | + | ||
28 | + assert(link); | ||
29 | + assert(link->manager); | ||
30 | + | ||
31 | + ORDERED_SET_FOREACH(req, link->manager->request_queue, i) | ||
32 | + if (req->link == link) | ||
33 | + request_drop(req); | ||
34 | +} | ||
35 | + | ||
36 | void link_drop(Link *link) { | ||
37 | if (!link) | ||
38 | return; | ||
39 | @@ -1782,6 +1793,8 @@ void link_drop(Link *link) { | ||
40 | /* Drop all references from other links and manager. Note that async netlink calls may have | ||
41 | * references to the link, and they will be dropped when we receive replies. */ | ||
42 | |||
43 | + link_drop_requests(link); | ||
44 | + | ||
45 | link_free_carrier_maps(link); | ||
46 | |||
47 | if (link->network) { | ||
48 | -- | ||
49 | 2.17.1 | ||
50 | |||