Fix sr_dev_has_option().
This wasn't taking the SR_CONF_GET/_SET/_LIST flags into account. Thanks to Janne Huttunen for spotting this.
This commit is contained in:
parent
818df9f8ec
commit
d099d88021
|
@ -191,7 +191,7 @@ SR_API gboolean sr_dev_has_option(const struct sr_dev_inst *sdi, int key)
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
devopts = g_variant_get_fixed_array(gvar, &num_opts, sizeof(int32_t));
|
devopts = g_variant_get_fixed_array(gvar, &num_opts, sizeof(int32_t));
|
||||||
for (i = 0; i < num_opts; i++) {
|
for (i = 0; i < num_opts; i++) {
|
||||||
if (devopts[i] == key) {
|
if ((devopts[i] & SR_CONF_MASK) == key) {
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue