summaryrefslogtreecommitdiff
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
commitb017df3812168650ae72628c7d0bcff7c415934e (patch)
treeb287f31c19e34c69b236259ac5b8ed8df7ed694c
parentf9f3ddebe8114e5186d1d0d00fb05ef799361d51 (diff)
downloadmtk-20170518-b017df3812168650ae72628c7d0bcff7c415934e.zip
mtk-20170518-b017df3812168650ae72628c7d0bcff7c415934e.tar.gz
mtk-20170518-b017df3812168650ae72628c7d0bcff7c415934e.tar.bz2
swconfig: avoid setting "NOVAL" attributes if "0" was provided as a value
SVN-Revision: 27374
-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 c2316d0..20e727e 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;