network/tc: re-enumerate traffic control classes when a qdisc created

Some kind of qdisc implicitly creates a class for the qdisc, but the
created class is not notified by the kernel. So, we need to explicitly
enumerate classes after a qdisc is created.
This commit is contained in:
Yu Watanabe
2023-10-07 21:35:16 +09:00
parent 4147618612
commit c9e70be162
+8
View File
@@ -536,6 +536,14 @@ int manager_rtnl_process_qdisc(sd_netlink *rtnl, sd_netlink_message *message, Ma
qdisc = TAKE_PTR(tmp);
}
if (!m->enumerating) {
/* Some kind of QDisc (e.g. tbf) also create an implicit class under the qdisc, but
* the kernel may not notify about the class. Hence, we need to enumerate classes. */
r = link_enumerate_tclass(link, qdisc->handle);
if (r < 0)
log_link_warning_errno(link, r, "Failed to enumerate TClass, ignoring: %m");
}
break;
case RTM_DELQDISC: