- p = (struct nlmsghdr *) nl->buffer;
-
- if (nl->callback) {
- for (; bytes > 0; p = NLMSG_NEXT(p, bytes)) {
- if (!NLMSG_OK(p, (size_t) bytes)) {
- avahi_log_warn(__FILE__": packet truncated");
- return -1;
- }
-
- nl->callback(nl, p, nl->userdata);
- }
+ if (cred->uid != 0)
+ return -1;
+
+ p = (struct nlmsghdr *) nl->buffer;
+
+ assert(nl->callback);
+
+ for (; bytes > 0; p = NLMSG_NEXT(p, bytes)) {
+ if (!NLMSG_OK(p, (size_t) bytes)) {
+ avahi_log_warn(__FILE__": packet truncated");
+ return -1;