From b0e03239c7e3ecc08c51daedfff3a9be04113a62 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 4 Jun 2014 11:15:44 +0200 Subject: netsniff-ng: proto_nlmsg: Add notice about nlmsg pid field The port id field of the netlink message header does not necessarily indicate the PID of the receiving process [1] (e.g. in case of multithreaded applications or using multiple sockets). Mention this in a comment. [1] http://www.carisma.slowglass.com/~tgr/libnl/doc/core.html#core_netlink_fundamentals Signed-off-by: Tobias Klauser --- proto_nlmsg.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/proto_nlmsg.c b/proto_nlmsg.c index 0098d27..3f5ef64 100644 --- a/proto_nlmsg.c +++ b/proto_nlmsg.c @@ -22,7 +22,13 @@ static void nlmsg(struct pkt_buff *pkt) if (hdr == NULL) return; - /* Look up the process name if message is not coming from the kernel */ + /* Look up the process name if message is not coming from the kernel. + * + * Note that the port id is not necessarily equal to the PID of the + * receiving process (e.g. if the application is multithreaded or using + * multiple sockets). In these cases we're not able to find a matching + * PID and the information will not be printed. + */ if (hdr->nlmsg_pid != 0) { char path[1024]; int ret; -- cgit v1.2.3-54-g00ecf