From: Yu Watanabe Date: Thu, 22 Nov 2018 16:24:34 +0000 (+0900) Subject: sd-device-monitor: fix subsystem filter X-Git-Tag: v240~240^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=65fe9c319f91579ee336ccaeba90df3e7f252ee6;p=thirdparty%2Fsystemd.git sd-device-monitor: fix subsystem filter This fixes a bug introduced by 759d9f3f8d07af2940bb3783acc3985ee47adfa5. Fixes #10882. --- 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); }