From e93c38c3a2daaa2a8fedac59037f43a0403fdd03 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 23 Apr 2009 03:33:58 +0200 Subject: [PATCH] libudev: monitor - do not filter messages with wrong magic --- udev/lib/libudev-monitor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/udev/lib/libudev-monitor.c b/udev/lib/libudev-monitor.c index d8b375c7..211aa12f 100644 --- a/udev/lib/libudev-monitor.c +++ b/udev/lib/libudev-monitor.c @@ -241,8 +241,8 @@ static int filter_apply(struct udev_monitor *udev_monitor) bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_ABS, offsetof(struct udev_monitor_netlink_header, magic)); /* jump if magic matches */ bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, UDEV_MONITOR_MAGIC, 1, 0); - /* wrong magic, drop packet */ - bpf_stmt(ins, &i, BPF_RET|BPF_K, 0); + /* wrong magic, pass packet */ + bpf_stmt(ins, &i, BPF_RET|BPF_K, 0xffffffff); /* add all subsystem match values */ udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_monitor->filter_subsystem_list)) { -- 2.39.5