From 82ddeaf23cd930ee3ea34a3993c20de3932e6710 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 17 Jul 2011 06:28:52 +0000 Subject: [PATCH] swconfig: avoid setting "NOVAL" attributes if "0" was provided as a value (backport of r27374) SVN-Revision: 27626 --- package/swconfig/src/swlib.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.30.2