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:
committed by
Greg Kroah-Hartman
parent
1b0b3b9980
commit
ca2f37dbc5
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user