From owner-freebsd-net@FreeBSD.ORG Thu Dec 13 18:57:51 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 36B5EA4D; Thu, 13 Dec 2012 18:57:51 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-qa0-f54.google.com (mail-qa0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id C82478FC0A; Thu, 13 Dec 2012 18:57:50 +0000 (UTC) Received: by mail-qa0-f54.google.com with SMTP id j15so3386503qaq.13 for ; Thu, 13 Dec 2012 10:57:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=pT+pxG7MCHP1BnNjsavf17J1jtD+A/dFrmNYKKI9Ksw=; b=YbfQMy2vUUcHeIsBwXSFSmtxMzExyDZydJEOiG04BOT74adZ3vcN+bcrEO6ueqrSzY zH5QQ9JJFLlzC5MGH0dg0doIQSda1+MjtmyK3+gmrCuFOS7ZhiYmzrK9fVrJF6gksqvi qdCgX0Y73FhP6fRGpdzmuohrWSi2ze9i4sZwex94xRyzS+wgykJ4eMu4n+PmXJv1klcY Yn+OOXOtNp+wiK6AhBTkDbCElNU16Lf8b0mlyilPShGhnyxMHdnXC3hT3zy3RApI/Ng3 KSecSSPLLnP6I9qxbta0/GcvLsvDYrgJNOVug+eQNSJobTpYraHDMgkWys/2ifHp5vOH 17uQ== MIME-Version: 1.0 Received: by 10.49.133.68 with SMTP id pa4mr1520059qeb.50.1355425069817; Thu, 13 Dec 2012 10:57:49 -0800 (PST) Sender: ermal.luci@gmail.com Received: by 10.49.27.197 with HTTP; Thu, 13 Dec 2012 10:57:49 -0800 (PST) In-Reply-To: <50CA0161.1060000@FreeBSD.org> References: <50C9C012.8020306@FreeBSD.org> <50C9C55A.5090900@ipfw.ru> <50CA0161.1060000@FreeBSD.org> Date: Thu, 13 Dec 2012 19:57:49 +0100 X-Google-Sender-Auth: D6uMwek53fxpIhJbdPDnDdxSO9U Message-ID: Subject: Re: ng_ether naming From: =?ISO-8859-1?Q?Ermal_Lu=E7i?= To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-net , "Alexander V. Chernikov" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 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, 13 Dec 2012 18:57:51 -0000 On Thu, Dec 13, 2012 at 5:25 PM, Andriy Gapon wrote: > on 13/12/2012 14:08 Alexander V. Chernikov said the following: > > On 13.12.2012 15:46, Andriy Gapon wrote: > >> > >> ng_ether uses if_xname for naming its nodes. > >> This could be troublesome for mapping interface names to their ng_ether > companions > >> in the face of interface renaming capability. Especially given that > interface > >> renaming and ng_ether _module_ loading may happen in an arbitrary order. > >> > >> I am not sure how to solve this best. > >> > >> One possibility is to use if_dname+if_dunit combination for ng_ether > naming. This > >> should be stable and available for querying. This behavior should also > be > >> backward compatible with ng_ether being compiled into kernel > (if_dname+if_dunit == > >> if_xname before any renaming could occur). > >> > >> Another possibility is to do ng_ether renaming when its interface is > renamed. > >> This seems nicer but appears to be more work and more intrusive, because > >> interfaces would have to know about their ng_ether nodes. > > > > Not exactly. You can register for ifnet_departure_event and > ifnet_arrival_event. > > > > Interface renaming is done via sending departure event with old name and > arrvial > > event with new one. > > Good to know. Thank you! > > > So which approach sounds better? > Or maybe there is even a better one? > > The best is interface event handling. Just recopy the new name from if_xname and should be done. > >> > >> What do you think? > >> Thank you. > >> > >> And just in case: > >> $ ifconfig -l > >> net0 lo0 > >> $ ngctl list > >> There are 2 total nodes: > >> Name: re0 Type: ether ID: 00000001 Num > hooks: 0 > >> Name: ngctl11353 Type: socket ID: 00000003 Num > hooks: 0 > >> > > > > > > > -- > Andriy Gapon > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > -- Ermal