tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Specifying names for tap interfaces

Manuel Bouyer wrote:
On Wed, Jul 04, 2012 at 06:05:02PM +0100, Roger Pau Monne wrote:
Darren Reed wrote:
On 30/06/2012 2:47 AM, Roger Pau Monné wrote:
For example being able to name Xen virtual interfaces in the
Dom0 with a user defined name, but I'm sure other users will come up with
other uses. What would you require for this functionality?
At the very last, being able to get the driver name and instance
number in a convenient way (e.g. in ifconfig output).
Ok, I will take a look at that, which I guess will require the
introduction of a new ioctl and a corresponding field in ifnet.
You could always find the original name in dmesg, since everytime
the name changes a line is printed, but I agree it might be
confusing and difficult if you perform a lot of renames.
Start with making the information available through drvctl
as part of the property list for the driver and don't worry
about ifconfig.

The attached patch adds a new ioctl to perform the rename and
propagate that rename to the associated device_t and sysctl entries.
Please review this patch and check that the use of the spls is
correct. I also had to change a part of the code of bpf_setif in
bpf.c to allow the use of interfaces that doesn't end with a number.

 From 3e90ed906c3b93a92be302e76455a22940e56d6f Mon Sep 17 00:00:00 2001
From: Roger Pau Monne<>
Date: Mon, 25 Jun 2012 14:58:32 +0100
Subject: [PATCH] net: add support to rename interfaces

Add a new ioctl "SIOCSIFNAME" to rename network interfaces and add
support for it in ifconfig.

The added ioctl changes the field if_xname and if_dl in the ifnet
structure, and propagates those changes to the associated sysctl
entries and device_t (if present), so drvctl works with the new name.

if I did read it properly, there's no way to know the driver and unit number
once the name has been changed ?

Yes it is, drvctl -p <new_name>, will print the driver and unit number.

Also, there is a change to bpf that looks unrelated. As it changes the
semantic, this should at last be documented.

The change to bpf is explained in the email. It is changed to accept interfaces not ending in a number, so you can use for example foo2bar as an interface name. Sorry, I should add this to the commit message and as a comment on top of bpf_setif.


Home | Main Index | Thread Index | Old Index