check if received netlink messages are really from the kernel (pid==0)
diff --git a/libipq/libipq.c b/libipq/libipq.c
index 709c8a2..a25ad4c 100644
--- a/libipq/libipq.c
+++ b/libipq/libipq.c
@@ -171,6 +171,10 @@
 		ipq_errno = IPQ_ERR_RECV;
 		return -1;
 	}
+	if (h->peer.nl_pid != 0) {
+		ipq_errno = IPQ_ERR_RECV;
+		return -1;
+	}
 	if (status == 0) {
 		ipq_errno = IPQ_ERR_NLEOF;
 		return -1;