aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2015-12-23 17:11:49 +0000
committerRafał Miłecki <zajec5@gmail.com>2015-12-23 17:11:49 +0000
commitd3051d44a94c3876f956d6cf5fe3ba77c44a901c (patch)
treec1ee064bfa710f7a700b6e0312b396df4be4969d /target
parentfb19b4a17271c5217e64adfb6c6af3018f63e091 (diff)
downloadmaster-187ad058-d3051d44a94c3876f956d6cf5fe3ba77c44a901c.tar.gz
master-187ad058-d3051d44a94c3876f956d6cf5fe3ba77c44a901c.tar.bz2
master-187ad058-d3051d44a94c3876f956d6cf5fe3ba77c44a901c.zip
ledtrig-netdev: reset link status & stats after changing device_name
Previously switching to non-existing device (interface) could result in leaving LED on. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47990 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/generic/files/drivers/leds/ledtrig-netdev.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/leds/ledtrig-netdev.c b/target/linux/generic/files/drivers/leds/ledtrig-netdev.c
index 4e0844a597..4e0fd667b0 100644
--- a/target/linux/generic/files/drivers/leds/ledtrig-netdev.c
+++ b/target/linux/generic/files/drivers/leds/ledtrig-netdev.c
@@ -122,6 +122,8 @@ static ssize_t led_device_name_store(struct device *dev,
strcpy(trigger_data->device_name, buf);
if (size > 0 && trigger_data->device_name[size-1] == '\n')
trigger_data->device_name[size-1] = 0;
+ trigger_data->link_up = 0;
+ trigger_data->last_activity = 0;
if (trigger_data->device_name[0] != 0) {
/* check for existing device to update from */