Q:possibility PFIL+mbuf use for packet spawning
Max Laier
max at love2party.net
Fri Jan 15 16:11:25 UTC 2010
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
More information about the freebsd-hackers
mailing list