linux - Extract PID from sk_buff. -


i looking way determine process sk_buff directed. know there no straightforward way that. obtain sk_buff i'm using netif_rx notifier. i've had use notifiers instead of netfilter, because netfilter works in interrupt context (but, if netfilter can in way more usefull in case, can switch).
i've tried far:
struct pid *sk_peer_pid struct sock *.
compare struct file * opened file descriptors struct files_struct of each task. heavy.
network namespaces. useless, since processes use same namespace, , feature not enabled default on device.

last idea compare somehow destination port packet, ports processes listening. there way that? desired port number packet, , up, , see process listening on it?


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -