From owner-freebsd-net@FreeBSD.ORG Thu Nov 20 13:50:33 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B14C81065678 for ; Thu, 20 Nov 2008 13:50:33 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by mx1.freebsd.org (Postfix) with ESMTP id 3E9368FC0C for ; Thu, 20 Nov 2008 13:50:32 +0000 (UTC) (envelope-from max@love2party.net) Received: from vampire.homelinux.org (dslb-088-067-236-069.pools.arcor-ip.net [88.67.236.69]) by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis) id 0ML21M-1L39vS31yv-0000Ic; Thu, 20 Nov 2008 14:50:31 +0100 Received: (qmail 86177 invoked from network); 20 Nov 2008 13:50:30 -0000 Received: from fbsd8.laiers.local (192.168.4.151) by laiers.local with SMTP; 20 Nov 2008 13:50:30 -0000 From: Max Laier Organization: FreeBSD To: freebsd-net@freebsd.org Date: Thu, 20 Nov 2008 14:50:29 +0100 User-Agent: KMail/1.10.1 (FreeBSD/8.0-CURRENT; KDE/4.1.1; i386; ; ) References: <49249443.8050707@elischer.org> <76CF7D15-251F-4E43-86BE-AD96F48AF123@lakerest.net> In-Reply-To: <76CF7D15-251F-4E43-86BE-AD96F48AF123@lakerest.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811201450.30016.max@love2party.net> X-Provags-ID: V01U2FsdGVkX1/pa2s+q3F8auTq4PnG5wTXZm9AMqm7nEVCfey mjtM7GzeyHOdvb1ye5hfPOJXze4mu7sInQYTdmemj8wo9Bp1Xp m9kCAiAKsP3EHjkg15Rzg== Cc: Randall Stewart , Julian Elischer Subject: Re: Thinking about UDP and tunneling X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2008 13:50:33 -0000 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