diff options
author | Jean Tourrilhes <jt@hpl.hp.com> | 2007-03-07 10:49:30 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-04-27 10:57:29 -0700 |
commit | ca2f37dbc5324c7278577731033a358f1f86050a (patch) | |
tree | 5085e9826220e047c1f53070355c4f194988241f /net/core | |
parent | 1b0b3b9980e482ab7c603430462538334f69f14a (diff) | |
download | kernel_goldelico_gta04-ca2f37dbc5324c7278577731033a358f1f86050a.zip kernel_goldelico_gta04-ca2f37dbc5324c7278577731033a358f1f86050a.tar.gz kernel_goldelico_gta04-ca2f37dbc5324c7278577731033a358f1f86050a.tar.bz2 |
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 221a64a..e441ec7 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, 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; + envp[i] = NULL; return 0; } |