All: Ok here is what I have come up with.. going along the lines of Max's suggestion.. its pretty clean I think.
Comments would be most welcome.. The only thing possibly a bit dodgy is that 1) UDP has no per-protocol block. 2) Instead of creating one, I am using the block pointer in the inp as the function pointer for the tunneling. What this means if we EVERY did add a per protocol structure for UDP we would need to move the function pointer in there.. The nice thing it does is make it so we have no structural changes to the code... i.e. complete compatibility... no changes to inp or other UDP structures :-) Here is the patch.. please send comments ;-D
diff_for_udp
Description: Binary data
On Nov 20, 2008, at 8:50 AM, Max Laier wrote:
On Thursday 20 November 2008 14:00:11 Randall Stewart wrote:On Nov 19, 2008, at 5:33 PM, Julian Elischer wrote:Its not new, its the same ip header.. Its just you go into the mbuf chain and take out the udp header...well you can't do that at the socket buffer becasue you've discardedthe IP header. It may not even be in the mbufs you have. (though it's unlikely). After you've processed the UDP part the IP part is gone soyou'd need to intercept the packet way earlier and then do your own UDP processing, (or maybe attach the IP header onto it with a tag).One would definitely have to do some work in udp_input() not a lot fromwhat I can tell... but it would take some work. Maybe good course is to use the socket(9) stuff, but add an option that can set a "by-pass function" if the socket is udp... right after you establish the INP the packet goes to, if the function is set, you engage the bypass...This sounds reasonable. One would only have to replace calls to udp_append in udp_input with the by-pass function et voila. Should be clean enough. Theremight be some problems with holding the socket lock, though.For the record, I don't like all the UDP-tunneling madness either, but it seems that we are stuck with it ... so we should at least try to come up witha somewhat reasonable implementation for this hackery. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News
------------------------------ Randall Stewart 803-317-4952 (cell) 803-345-0391(direct)
_______________________________________________ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "[EMAIL PROTECTED]"