Date: Thu, 20 Nov 2008 14:50:29 +0100 From: Max Laier <max@love2party.net> To: freebsd-net@freebsd.org Cc: Randall Stewart <rrs@lakerest.net>, Julian Elischer <julian@elischer.org> Subject: Re: Thinking about UDP and tunneling Message-ID: <200811201450.30016.max@love2party.net> In-Reply-To: <76CF7D15-251F-4E43-86BE-AD96F48AF123@lakerest.net> References: <D72E9703-C8E7-4A21-A71E-A4B4C2D7E8F4@lakerest.net> <49249443.8050707@elischer.org> <76CF7D15-251F-4E43-86BE-AD96F48AF123@lakerest.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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 discarded > > the 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 so > > you'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 from > what 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. There might 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 with a somewhat reasonable implementation for this hackery. -- /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811201450.30016.max>