Port-xen archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Specifying names for tap interfaces
On Wed, Jun 20, 2012 at 05:42:08PM +0100, Roger Pau Monne wrote:
> Manuel Bouyer wrote:
> >On Thu, Jun 21, 2012 at 12:24:48AM +1000, Darren Reed wrote:
> >>[...]
> >>The first issue that you face that for all intents and purposes, you
> >>cannot change "struct ifnet" because it is in too many places and
> >>change will likely have a huge waterfall effect. So that can't be
> >>changed.
> >
> >that's not true. struct ifnet can and has been changed, the last
> >time was 2011/10/19.
> >But this will likely cause ABI issues; if this has to be pulled up to
> >netbsd-6
> >and/or netbsd-5, this needs to be carefully examinated.
> >
>
> There has been a lot of chat here, but I think the general idea is
> that the FreeBSD way of changing interface names is not acceptable
> on NetBSD. I was halfway on doing that change to NetBSD.
>
> So, we would like to be able to create interface alias, here is what
> I think should be doable (from my PoV):
>
> Adding a field to ifnet to contain that alias, something like
> if_xalias, then being able to set that name with an ioctl (something
> like SIOCSIFALIAS) and to fetch if with an ioctl also
> (SIOCGIFALIAS). I think this can be done using the already present
> ifreq struct, and getting/setting the alias from the ifr_name field.
>
> What I'm not sure is how to propagate that change to every tool that
> interacts with network interfaces, we should of course change
> ifconfig to be able to set/get this aliases, but then changes will
> also be required to brconfig, pf...?
I would do it at the kernel level: name and aliases are different namespace,
if we embed the namespace information in the string (e.g. alias:foo vs foo),
then you just use the same SIOCGIFADDR() with the same 'struct ifreq'
and the kernel does the job. I suspect most tools won't need to be changed
(ifconfig probably will, though)
> Also, when the user specifies something like ifconfig alias:foo up,
> how do we know to what is alias:foo mapped to? Querying all possible
> network interfaces to find it's aliases? Querying all interfaces to
> get it's aliases it's a very big overhead.
See above.
--
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
NetBSD: 26 ans d'experience feront toujours la difference
--
Home |
Main Index |
Thread Index |
Old Index