From 65fe9c319f91579ee336ccaeba90df3e7f252ee6 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 23 Nov 2018 01:24:34 +0900 Subject: [PATCH] sd-device-monitor: fix subsystem filter This fixes a bug introduced by 759d9f3f8d07af2940bb3783acc3985ee47adfa5. Fixes #10882. --- src/libsystemd/sd-device/device-monitor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libsystemd/sd-device/device-monitor.c b/src/libsystemd/sd-device/device-monitor.c index bb50257a0df..05e7ec07159 100644 --- a/src/libsystemd/sd-device/device-monitor.c +++ b/src/libsystemd/sd-device/device-monitor.c @@ -648,13 +648,12 @@ _public_ int sd_device_monitor_filter_update(sd_device_monitor *m) { /* jump if subsystem does not match */ bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, hash, 0, 1); } else { - hash = string_hash32(devtype); - /* jump if subsystem does not match */ bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, hash, 0, 3); /* load device devtype value in A */ bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_ABS, offsetof(monitor_netlink_header, filter_devtype_hash)); /* jump if value does not match */ + hash = string_hash32(devtype); bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, hash, 0, 1); }