All of lore.kernel.org
 help / color / mirror / Atom feed
* generalized packet modification (inc tcpflags, adding options)
@ 2003-06-30 16:47 Don Cohen
  2003-06-30 17:05 ` Patrick McHardy
  0 siblings, 1 reply; 2+ messages in thread
From: Don Cohen @ 2003-06-30 16:47 UTC (permalink / raw)
  To: Mohammed Awad, Craig Shelley, netfilter-devel


The u32 match I sent in (I think about 6 months ago) was meant as a
generalization of lots of much more specific matches, such as ttl or
length.  I had hoped to generalize that to allow modification of
arbitrary bits in the packet, which would take care of many other
current modules, including the tcp flag example.
I've not gotten around to it, partly because I've not had a specific
burning need, but I'd like to encourage anyone with a better
(competence + motivation) than mine to do that.

It's not immediately clear to me what language would be best for 
describing such modifications and that would probably be worth
discussing on this list.  For that matter, it's not clear what
language is best for describing the match.  My u32 language was
designed to do what seems to be needed for IPv4 but is not good
for IPv6.  I recall someone (Patrick?) supplied a BPF analog of the
u32 match.  (Where can I find that, BTW?)  Is that language capable of
specifying data modification?  Of course other important issues
include run time efficiency and convenience for the user.

All of above seems much more complicated when you start to make
modifications that change the packet size.  (And this includes adding
options.)  I have code that adds a new option but it's not just a
module.  I've changed the kernel to deal with the problem that this
might cause the packet to exceed MTU and if so it might have DF, and
then we want to send back an ICMP reply suggesting a smaller size.
And it gets even more complicated when you try to change things like
TCP payload, which affects TCP sequence numbers of all subsequent
packets in the connection.  I know there are some modules that do this
now, I think related to NAT on protocols that send port numbers in
decimal (so the number of digits can be changed by NAT).

I'd be interested in discussion of a general approach to this problem 
too, but I think it will be a lot more worth while in the short run
(most of the benefit for much less effort) to deal with only changing
the bits that are there and not trying to add or delete them.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-06-30 17:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-30 16:47 generalized packet modification (inc tcpflags, adding options) Don Cohen
2003-06-30 17:05 ` Patrick McHardy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.