Anyone having problem modify incoming IP packets at NetFilter Hoo k Module PREROUTING?
flat view
From: Wai Yim <hidden>
Date: 2003-05-23 01:02:34
From: Wai Yim <hidden>
Date: 2003-05-23 01:02:34
Hi All, I am new to Linux and NetFilter. I am trying to write a NetFilter Hook Module that hooks to both POSTROUTING and PREROUTING filter. All I am trying to do is, if an IP packet is for certain dest IP address, I will add (POSTROUTING) and take-out (PREROUTING)certain number of bytes in the packet before I pass on the packet. The POSTROUTING NetFilter hook seems working fine. I can get all of the outgoing IP packets, and I can call skb_copy_expand + skb_push for the new data.
From ethereal, I see correct outgoing packets onto the
network. However, here is the problem, when I get a packet at the PREROUTING, and for certain packets that are about the size of the MTU, when I call skb_copy or skb_pull, my entire system freezes right the way! Upon further investigation, when the trouble packet arrives, even reading data from skb->data using memcpy will freeze the system. I have exhausted all combination of things that I can try... Any help, idea, or direction as what else I should try or where the problem may be will be deeply appreciated. Wai