Date: Fri, 14 Dec 2012 19:38:03 +0200 From: Nikolay Denev <ndenev@gmail.com> To: Andriy Gapon <avg@freebsd.org> Cc: =?iso-8859-1?Q?Ermal_Lu=E7i?= <eri@FreeBSD.org>, freebsd-net <freebsd-net@FreeBSD.org>, "Alexander V. Chernikov" <melifaro@ipfw.ru> Subject: Re: ng_ether naming Message-ID: <75277A1B-B434-4220-A800-9004C29DA92A@gmail.com> In-Reply-To: <50CB5B8A.8030703@FreeBSD.org> References: <50C9C012.8020306@FreeBSD.org> <50C9C55A.5090900@ipfw.ru> <50CA0161.1060000@FreeBSD.org> <CAPBZQG3Yo_73Ao8Ribvr2Cshii_yKfrPaJCuOGcP44fAaG1ziQ@mail.gmail.com> <50CB5B8A.8030703@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Dec 14, 2012, at 7:02 PM, Andriy Gapon <avg@freebsd.org> wrote: > on 13/12/2012 20:57 Ermal Lu=E7i said the following: >>=20 >>=20 >>=20 >> On Thu, Dec 13, 2012 at 5:25 PM, Andriy Gapon <avg@freebsd.org >> <mailto:avg@freebsd.org>> wrote: >>=20 >> on 13/12/2012 14:08 Alexander V. Chernikov said the following: >>> On 13.12.2012 15:46, Andriy Gapon wrote: >>>>=20 >>>> 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. >>>>=20 >>>> I am not sure how to solve this best. >>>>=20 >>>> 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 =3D=3D >>>> if_xname before any renaming could occur). >>>>=20 >>>> 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. >>>=20 >>> Not exactly. You can register for ifnet_departure_event and = ifnet_arrival_event. >>>=20 >>> Interface renaming is done via sending departure event with old name = and arrvial >>> event with new one. >>=20 >> Good to know. Thank you! >>=20 >>=20 >> So which approach sounds better? >> Or maybe there is even a better one? >>=20 >>=20 >> The best is interface event handling. >> Just recopy the new name from if_xname and should be done. >=20 > There is one problem with the current code which would automatically = apply to the > interface renaming handling. > ng_ether does not do any validation or "normalization" of if_xname and = the name > can contain symbols which are prohibited in a netgraph name, such as = '.' for example. > ng_name_node would fail and warning would be logged but a node would = stay unnamed. > I am a bit reluctant to write "netgraph name escaping" code myself. = Perhaps it > already exists in some place? >=20 > --=20 > 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" Hi, Some time ago I had similar issue : = http://lists.freebsd.org/pipermail/freebsd-net/2011-February/027982.html The patch is also in : kern/154850 -- Nikolay=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?75277A1B-B434-4220-A800-9004C29DA92A>