swconfig: avoid setting "NOVAL" attributes if "0" was provided as a value (backport...
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 17 Jul 2011 06:28:52 +0000 (06:28 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 17 Jul 2011 06:28:52 +0000 (06:28 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/branches/backfire@27626 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/swconfig/src/swlib.c

index c2316d06864ce554568dc107873a0b98f3025875..20e727eb5371c88bcf0c5d80c3eadc4cd98cf9f5 100644 (file)
@@ -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;