开发者

How do you return stolen packets back to Netfilter

开发者 https://www.devze.com 2022-12-23 19:54 出处:网络
Let\'s say I have intercepted a packet from Netfilter and subsequently returned NF_STOLEN.At some point I want to re-inject that packet back to, in this case, the TCP stream it came fro开发者_如何转开

Let's say I have intercepted a packet from Netfilter and subsequently returned NF_STOLEN. At some point I want to re-inject that packet back to, in this case, the TCP stream it came fro开发者_如何转开发m. I want to do this from Kernel space. So far I have been unable to find a way to do this. Thanks for the help.


Ok, should have searched a bit longer...

nf_reinject(..) seems to be proper way of handling this.


Can you please explain what really you want to achieve here. Because if you return NF_STOLEN, that means you have already sent/processed that packet (i.e by calling dev_queue_xmit). If you have not sent or consumed that packet and want to be processed by kernel later then use NF_QUEUE and nf_reinject.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号