The NF_INET_LOCAL_OUT hook has skb->sk pointing to a struct sock for the socket that sent the packet. If there a hook that has it set for the socket that receives the packet? In the NF_INET_LOCAL_IN hook, skb->sk is null. Will I have to use __inet_lookup_skb()? If so, what is the complexity of that function? EDIT: looks like __inet_lookup_skb() is for
Tag: netfilter
Receiving socket information from netfilter NF_INET_PRE_ROUTING hook function in linux kernel
I wrote a netfilter hook function for incoming packets in linux kernel. Is there a way to get the receiving socket information from the hook function. The code is Lets assume I have a udp socket open at port 15000 and a udp packet arrives at port 15000. In the above written hook function how can I access the struct
Recreate and send packet captured by nfqueue
I capture all the packets in one side with help of nfqueue, “record” them (all the data: ip info, next protocol info etc) with nfq_get_payload and deliver them into another side with help of udp. How can I restore this packet on another side and then send to myself(2 side) like there is no udp-encapsulation between? Should I use some