Commit b31d4850 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Don't loop forever if there's no filter.

parent ff5e0e6f
...@@ -223,14 +223,10 @@ netlink_read(int (*filter)(struct nlmsghdr *, void *data), void *data) ...@@ -223,14 +223,10 @@ netlink_read(int (*filter)(struct nlmsghdr *, void *data), void *data)
return -1; return -1;
} }
debugf("netlink_read: FILTER\n"); if(filter)
filter(nh, data);
if(filter) { if(!(nh->nlmsg_flags & NLM_F_MULTI))
err = filter(nh, data); break;
if(err || !(nh->nlmsg_flags & NLM_F_MULTI))
return err;
}
} }
debugf("\n"); debugf("\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment