diff options
author | Jean Tourrilhes <jt@hpl.hp.com> | 2007-03-07 13:49:30 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-04-27 13:57:29 -0400 |
commit | ca2f37dbc5324c7278577731033a358f1f86050a (patch) | |
tree | 5085e9826220e047c1f53070355c4f194988241f /net/core | |
parent | 1b0b3b9980e482ab7c603430462538334f69f14a (diff) |
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>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/net-sysfs.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 221a64ab64f7..e441ec7988c1 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
@@ -424,6 +424,17 @@ static int netdev_uevent(struct device *d, char **envp, | |||
424 | if ((size <= 0) || (i >= num_envp)) | 424 | if ((size <= 0) || (i >= num_envp)) |
425 | return -ENOMEM; | 425 | return -ENOMEM; |
426 | 426 | ||
427 | /* pass ifindex to uevent. | ||
428 | * ifindex is useful as it won't change (interface name may change) | ||
429 | * and is what RtNetlink uses natively. */ | ||
430 | envp[i++] = buf; | ||
431 | n = snprintf(buf, size, "IFINDEX=%d", dev->ifindex) + 1; | ||
432 | buf += n; | ||
433 | size -= n; | ||
434 | |||
435 | if ((size <= 0) || (i >= num_envp)) | ||
436 | return -ENOMEM; | ||
437 | |||
427 | envp[i] = NULL; | 438 | envp[i] = NULL; |
428 | return 0; | 439 | return 0; |
429 | } | 440 | } |