summaryrefslogtreecommitdiffstats
path: root/avahi-core/netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'avahi-core/netlink.c')
-rw-r--r--avahi-core/netlink.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/avahi-core/netlink.c b/avahi-core/netlink.c
index b2a6684..893295d 100644
--- a/avahi-core/netlink.c
+++ b/avahi-core/netlink.c
@@ -62,6 +62,12 @@ int avahi_netlink_work(AvahiNetlink *nl, int block) {
p = (struct nlmsghdr *) nl->buffer;
+ /* Check that this message originated from the kernel,
+ or a request from avahi itself, and not another process */
+ if ((p->nlmsg_pid != 0) && (p->nlmsg_pid != getpid())) {
+ return -1;
+ }
+
assert(nl->callback);
for (; bytes > 0; p = NLMSG_NEXT(p, bytes)) {