network: refuse further requests when manager is in MANAGER_STOPPED

In that case, requests will never be processed anyway. But further more,
we cannot call link_ref() at that stage. Otherwise, we trigger assertion.
This commit is contained in:
Yu Watanabe
2024-11-03 09:14:36 +09:00
parent d980aee1e8
commit ef45f5c8d0
4 changed files with 26 additions and 0 deletions
+3
View File
@@ -38,6 +38,9 @@ static int netlabel_command(uint16_t command, const char *label, const Address *
assert(address->link->manager->genl);
assert(IN_SET(address->family, AF_INET, AF_INET6));
if (address->link->manager->state == MANAGER_STOPPED)
return 0; /* We cannot call link_ref() below. */
r = sd_genl_message_new(address->link->manager->genl, NETLBL_NLTYPE_UNLABELED_NAME, command, &m);
if (r < 0)
return r;