aboutsummaryrefslogtreecommitdiffstats
path: root/package/swconfig/src
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-07-03 04:19:59 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-07-03 04:19:59 +0000
commitb6aaf185c74c02e450c866cc440cd18e5a81624d (patch)
tree3ea7f0603ce6221d1399f7e8feacf346d3a9a75e /package/swconfig/src
parent8a6ddb7ebfbd83c59cd1b13bc009696d1d25ffde (diff)
downloadupstream-b6aaf185c74c02e450c866cc440cd18e5a81624d.tar.gz
upstream-b6aaf185c74c02e450c866cc440cd18e5a81624d.tar.bz2
upstream-b6aaf185c74c02e450c866cc440cd18e5a81624d.zip
swconfig: avoid setting "NOVAL" attributes if "0" was provided as a value
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27374 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/swconfig/src')
-rw-r--r--package/swconfig/src/swlib.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/package/swconfig/src/swlib.c b/package/swconfig/src/swlib.c
index c2316d0686..20e727eb53 100644
--- a/package/swconfig/src/swlib.c
+++ b/package/swconfig/src/swlib.c
@@ -397,6 +397,9 @@ int swlib_set_attr_string(struct switch_dev *dev, struct switch_attr *a, int por
val.value.ports = ports;
break;
case SWITCH_TYPE_NOVAL:
+ if (str && !strcmp(str, "0"))
+ return 0;
+
break;
default:
return -1;