Network Filter
by slipknothoudini from LinuxQuestions.org on (#5KKYP)
I am trying to write a network filter that will take in traffic and alter things like the destination ip or a destination port effectively redirecting network traffic. In my filter I simply alter the sk_buff. For example (given that socket_buff is the provided sk_buff*:
tcph = tcp_hdr(socket_buff);
tcph->dest = htons(some_port_of_my_choosing);
this does not seem to work. Any tips as to how I might go about doing this would be much appreciated.
tcph = tcp_hdr(socket_buff);
tcph->dest = htons(some_port_of_my_choosing);
this does not seem to work. Any tips as to how I might go about doing this would be much appreciated.