From owner-freebsd-net@FreeBSD.ORG Fri Dec 12 13:38:44 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 8D941106564A for ; Fri, 12 Dec 2008 13:38:44 +0000 (UTC) (envelope-from mav@mavhome.dp.ua) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id 0F77F8FC23 for ; Fri, 12 Dec 2008 13:38:43 +0000 (UTC) (envelope-from mav@mavhome.dp.ua) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from orphanage.alkar.net (account mav@alkar.net [212.86.226.11] verified) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPA id 229626059; Fri, 12 Dec 2008 15:38:42 +0200 Message-ID: <49426962.5070809@mavhome.dp.ua> Date: Fri, 12 Dec 2008 15:38:42 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.14 (X11/20080612) MIME-Version: 1.0 To: Nikos Vassiliadis References: <1229005383.00046904.1228994401@10.7.7.3> <49421EB0.7040205@mavhome.dp.ua> <200812121429.38205.nvass@teledomenet.gr> In-Reply-To: <200812121429.38205.nvass@teledomenet.gr> Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: ng_bridge + ng_ksocket 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: Fri, 12 Dec 2008 13:38:44 -0000 Nikos Vassiliadis wrote: > On Friday 12 December 2008 10:20:00 Alexander Motin wrote: >> Five years ago I had the same problem. In result, I have written a small >> program which monitor interface with libpcap and calls script to >> reconnect ng_ksocket to the new peer address/port when it changes. >> >> The code is old, dirty and was not used for a long time, but if you wish >> to try that way - it is attached. > > It works, but I don't want go to down that road. > I was hopping that I was missing something... > > Would you ever consider such a feature, totally unrelated > to PPP, for mpd? Feature of what? ksocket is just a building brick, not a complete end-user solution. It is just a netgraph wrapper around kernel socket implementation. It may be sufficient for trivial cases, but no more. UDP socket is connectionless, so it does not handle remote address change. If it is connected to some remote address/port it just will not receive any other packet. You need some daemon to handle any additional logic. One simple example I have send to you. Another one is MPD, implementing L2TP and PPP-over-UDP links. Mpd opens separate UDP socket in user-level which catches everything that wasn't caught by existing connected sockets in netgraph and dynamically creates and connects additional UDP sockets in netgraph to handle this traffic. -- Alexander Motin