Netgraph node to replace packet contents?

Alexander Motin mav at FreeBSD.org
Sun Aug 26 07:05:16 PDT 2007


Hi.

Norberto Meijome wrote:
> is there any already existing  Netgraph node that would allow me to replace bytes in the data part of a packet?  I'm talking about generic "foo" for "BAR" replacement, though different lengths  would be good too.

There is no such node.

This is not an easy task to alter some abstract packet. Even in 
simpliest case you should take into account TCP/UDP checksumms. There 
could be problems with fragmented packets. In more complicated cases may 
be required other modifications.

To replace string with different length one you should also correct 
packet length. It is possible for UDP (except for the not first packet 
fragments), but for TCP it is probably completely impossible without 
doing complete TCP proxying to modify sequence numbers.

-- 
Alexander Motin


More information about the freebsd-net mailing list