Driver core: notify userspace of network device renames

Provide rename event for when we rename network devices.

Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Jean Tourrilhes
2007-03-07 10:49:30 -08:00
committed by Greg Kroah-Hartman
parent 1b0b3b9980
commit ca2f37dbc5
2 changed files with 41 additions and 0 deletions

View File

@@ -421,6 +421,17 @@ static int netdev_uevent(struct device *d, char **envp,
buf += n;
size -= n;
if ((size <= 0) || (i >= num_envp))
return -ENOMEM;
/* pass ifindex to uevent.
* ifindex is useful as it won't change (interface name may change)
* and is what RtNetlink uses natively. */
envp[i++] = buf;
n = snprintf(buf, size, "IFINDEX=%d", dev->ifindex) + 1;
buf += n;
size -= n;
if ((size <= 0) || (i >= num_envp))
return -ENOMEM;