lkml.org 
[lkml]   [2005]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: How to obtain process ID that created a packet

>> The question is: when do you test for the PID? You would have to do it
>> within send(), because anywhere else, you do not know. A socket may be
>> shared among multiple processes (most simple way: fork()).
>
>I'm hooking in NF_IP_LOCAL_OUT of netfilter code using nf_register_hook() function.

In sys_send(), I would have said you could use "current", but in netfilter
I can't tell exactly whether it is going to work on SMP.

Check net/ipv4/netfilter/ipt_owner.c, it provides a way to match packets vs
pids, but it's not easy to find out.



Jan Engelhardt
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-12-27 09:31    [W:0.062 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site