diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-05-17 08:23:57 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-05-18 13:40:50 +0200 |
commit | ce9388d72a710ffc4840572fecdfe7d9c0be0956 (patch) | |
tree | a5d5b99ef1e4401826060cac09e8392378ab2095 /src/network/networkd-nexthop.c | |
parent | man: only the system manager does not pass vars in ManagerEnvironment= (diff) | |
download | systemd-ce9388d72a710ffc4840572fecdfe7d9c0be0956.tar.xz systemd-ce9388d72a710ffc4840572fecdfe7d9c0be0956.zip |
network: fix possible message counter double decrement
When after_configure() for a request fails, then the request is not
removed from the queue at that time, and the link enters to failed
state. After that, if the link is reconfigured or its carrier is lost,
then the request is dropped from the queue, and the message_counter is
decreased. However, the counter is already or will be also decreased
when the corresponding netlink reply is received.
So, the counter is decreased twice.
Diffstat (limited to 'src/network/networkd-nexthop.c')
-rw-r--r-- | src/network/networkd-nexthop.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/networkd-nexthop.c b/src/network/networkd-nexthop.c index 5c6c58356c..013bddf30c 100644 --- a/src/network/networkd-nexthop.c +++ b/src/network/networkd-nexthop.c @@ -751,6 +751,9 @@ int request_process_nexthop(Request *req) { if (r < 0) return r; + /* To prevent a double decrement on failure in after_configure(). */ + req->message_counter = NULL; + if (req->after_configure) { r = req->after_configure(req, ret); if (r < 0) |