aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-27 15:58:54 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-27 15:58:54 -0400
commitd868772fff6c4b881d66af8640251714e1aefa98 (patch)
treec95a68d358d5c875d25763ffe9a44fe9f2081f34 /net
parenta205752d1ad2d37d6597aaae5a56fc396a770868 (diff)
parent404d5b185b4eb56d6fa2f7bd27833f8df1c38ce4 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (46 commits) dev_dbg: check dev_dbg() arguments drivers/base/attribute_container.c: use mutex instead of binary semaphore mod_sysfs_setup() doesn't return errno when kobject_add_dir() failure occurs s2ram: add arch irq disable/enable hooks define platform wakeup hook, use in pci_enable_wake() security: prevent permission checking of file removal via sysfs_remove_group() device_schedule_callback() needs a module reference s390: cio: Delay uevents for subchannels sysfs: bin.c printk fix Driver core: use mutex instead of semaphore in DMA pool handler driver core: bus_add_driver should return an error if no bus debugfs: Add debugfs_create_u64() the overdue removal of the mount/umount uevents kobject: Comment and warning fixes to kobject.c Driver core: warn when userspace writes to the uevent file in a non-supported way Driver core: make uevent-environment available in uevent-file kobject core: remove rwsem from struct subsystem qeth: Remove usage of subsys.rwsem PHY: remove rwsem use from phy core IEEE1394: remove rwsem use from ieee1394 core ...
Diffstat (limited to 'net')
-rw-r--r--net/core/net-sysfs.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 221a64ab64f7..b21307b15b82 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -412,20 +412,25 @@ static int netdev_uevent(struct device *d, char **envp,
412 int num_envp, char *buf, int size) 412 int num_envp, char *buf, int size)
413{ 413{
414 struct net_device *dev = to_net_dev(d); 414 struct net_device *dev = to_net_dev(d);
415 int i = 0; 415 int retval, len = 0, i = 0;
416 int n;
417 416
418 /* pass interface to uevent. */ 417 /* pass interface to uevent. */
419 envp[i++] = buf; 418 retval = add_uevent_var(envp, num_envp, &i,
420 n = snprintf(buf, size, "INTERFACE=%s", dev->name) + 1; 419 buf, size, &len,
421 buf += n; 420 "INTERFACE=%s", dev->name);
422 size -= n; 421 if (retval)
423 422 goto exit;
424 if ((size <= 0) || (i >= num_envp)) 423
425 return -ENOMEM; 424 /* pass ifindex to uevent.
426 425 * ifindex is useful as it won't change (interface name may change)
426 * and is what RtNetlink uses natively. */
427 retval = add_uevent_var(envp, num_envp, &i,
428 buf, size, &len,
429 "IFINDEX=%d", dev->ifindex);
430
431exit:
427 envp[i] = NULL; 432 envp[i] = NULL;
428 return 0; 433 return retval;
429} 434}
430#endif 435#endif
431 436