Please answer me about modifying sk_buff( or packet anywayz...)
Hi... everyone..
First of all.. Thanx to you for reading... and forgive my poor english.. :(
I have a problem that modifying packet with netfilter..
My program is devided in 2 part..(server and client programmed in kernel module)
The Client program(actually NF_IP_LOCAL_OUT hook function) modify protocol field of ip header in sk_buff..
For example.. if TCP packet is hooked, I change the protocol field of ip header 6 to 224(It's randomly selected..) and return NF_ACCEPT
And.. Server program(obviously NF_IP_LOCAL_IN hook function) modify protocol field of ip header too. and return NF_ACCEPT
In server case.. if hooked in packet's protocol field of ip header is 224(It is a modified packet by client program), it just change the number to 6 and return NF_ACCEPT
So I test this program.. It is succesful for client to server connection..(tested in telnet. ssh. ftp, http) But I try to connect server to client, it's impossible..
Client send a SYN&ACK packet... but Server received anything.. ( I check this in NF_IP_PRE_ROUTING and NF_IP_POST_ROUTING)
How can I solve this problem..? Thanx again.. for reading..
Quoted 1 line · Ghacker
How can I solve this problem..? Thanx again.. for reading..
maybe by considering that the IP header is covered by a checksum that has to be altered if the header is altered?
Signature · 5 lines
- Harald Welte <[email protected]> http://www.netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie