Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jan 2010 17:11:23 +0100
From:      Max Laier <max@love2party.net>
To:        freebsd-hackers@freebsd.org
Cc:        q q <lsimakov@gmail.com>
Subject:   Re: Q:possibility PFIL+mbuf use for packet spawning
Message-ID:  <201001151711.23061.max@love2party.net>
In-Reply-To: <e78f41ed1001150326t5df1a5bam4be5bc49492a57e5@mail.gmail.com>
References:  <e78f41ed1001150326t5df1a5bam4be5bc49492a57e5@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 15 January 2010 12:26:06 q q wrote:
> I'm using pfil as packet filter for packet modifications.
> 
> Is it possible to spawn new packets to network from pfil using mbuf?

You can call into ip_output with a new mbuf to send a new packet.  See for 
example pf_send_tcp in contrib/pf/net/pf.c

> Another question: im using m_append to change packet length and add
>  data(its working, at least server got longer message) but when i wireshark
>  clients packets(win machine) i see that i got acknoledge on older length
>  not on new one. Am i missunderstanding something?

Assuming you are talking about tcp packets (otherwise there wouldn't be an 
ack), you have to alter the tcp header, checksums, etc. as well.  Just adding 
data doesn't work.

Regards,
--
  Max



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