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.
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)
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)
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)
if (r < 0)
return r;
+ /* To prevent a double decrement on failure in after_configure(). */
+ req->message_counter = NULL;
+
if (req->after_configure) {
assert(n_routes > 0);
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)