At revision 59fad7a97cc67b35f2ae28b4228f92203c25c5d3, state_setinfo() compares the old and new values using strcasecmp(). A replacement that differs only in letter case is treated as unchanged, leaving the previous value stored.
A small check linked against the built common state library used:
st_tree_t *root = NULL;
int changed;
char *string_flags[] = { "STRING", "RW" };
state_setinfo(&root, "device.contact", "Operations");
state_setflags(root, "device.contact", 2, string_flags);
changed = state_setinfo(&root, "device.contact", "operations");
printf("changed=%d stored=%s\n",
changed, state_getinfo(root, "device.contact"));
state_infofree(root);
Actual output:
changed=0 stored=Operations
Expected output:
changed=1 stored=operations
This matters for text values such as device.contact, documented as an opaque string. The MGE MIB mapping exposes that variable as a writable string. Case-only corrections to such values should survive publication.
Comparing stored values byte-for-byte would preserve these changes while leaving variable-name matching case-insensitive. Immutable-value behaviour should remain unchanged. Related PR #2549 concerns immutable-flag propagation and does not change this value comparison.
The result above comes from the shared state-library check with the variable marked STRING|RW. Controls for identical values, variable-name case matching, different mutable values and immutable values passed. No physical-device write was performed.
Investigated and drafted with assistance from OpenAI Codex (gpt-6-astra).
At revision
59fad7a97cc67b35f2ae28b4228f92203c25c5d3, state_setinfo() compares the old and new values usingstrcasecmp(). A replacement that differs only in letter case is treated as unchanged, leaving the previous value stored.A small check linked against the built common state library used:
Actual output:
Expected output:
This matters for text values such as device.contact, documented as an opaque string. The MGE MIB mapping exposes that variable as a writable string. Case-only corrections to such values should survive publication.
Comparing stored values byte-for-byte would preserve these changes while leaving variable-name matching case-insensitive. Immutable-value behaviour should remain unchanged. Related PR #2549 concerns immutable-flag propagation and does not change this value comparison.
The result above comes from the shared state-library check with the variable marked
STRING|RW. Controls for identical values, variable-name case matching, different mutable values and immutable values passed. No physical-device write was performed.Investigated and drafted with assistance from OpenAI Codex (gpt-6-astra).