aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/core/net-sysfs.c11
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}