Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Aug 2007 15:54:43 +0300
From:      Alexander Motin <mav@FreeBSD.org>
To:        Norberto Meijome <freebsd@meijome.net>
Cc:        FreeBSD Net ML <freebsd-net@freebsd.org>
Subject:   Re: Netgraph node to replace packet contents?
Message-ID:  <46D17813.8090205@FreeBSD.org>
In-Reply-To: <1188123847.00792375.1188111626@10.7.7.3>
References:  <1188123847.00792375.1188111626@10.7.7.3>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?46D17813.8090205>