assert_return(m, -EINVAL);
- if (!m->filter_uptodate) {
- r = sd_device_monitor_filter_update(m);
- if (r < 0)
- return log_debug_errno(r, "sd-device-monitor: Failed to update filter: %m");
- }
+ r = sd_device_monitor_filter_update(m);
+ if (r < 0)
+ return log_debug_errno(r, "sd-device-monitor: Failed to update filter: %m");
if (!m->bound) {
if (bind(m->sock, &m->snl.sa, sizeof(struct sockaddr_nl)) < 0)
assert_return(m, -EINVAL);
+ if (m->filter_uptodate)
+ return 0;
+
if (hashmap_isempty(m->subsystem_filter) &&
set_isempty(m->tag_filter)) {
m->filter_uptodate = true;