Skip to content

Commit

Permalink
drivers/dstate.c, common/state.c: allow to dump and receive "IMMUTABL…
Browse files Browse the repository at this point in the history
…E" flag value [networkupstools#266]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Jul 23, 2024
1 parent 7cc3876 commit 405834e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions common/state.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,11 @@ void state_setflags(st_tree_t *root, const char *var, size_t numflags, char **fl

for (i = 0; i < numflags; i++) {

if (!strcasecmp(flag[i], "IMMUTABLE")) {
sttmp->flags |= ST_FLAG_IMMUTABLE;
continue;
}

if (!strcasecmp(flag[i], "RW")) {
sttmp->flags |= ST_FLAG_RW;
continue;
Expand Down
3 changes: 3 additions & 0 deletions drivers/dstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,9 @@ static int st_tree_dump_conn(st_tree_t *node, conn_t *conn)
/* build the list */
snprintf(flist, sizeof(flist), "%s", node->var);

if (node->flags & ST_FLAG_IMMUTABLE) {
snprintfcat(flist, sizeof(flist), " IMMUTABLE");
}
if (node->flags & ST_FLAG_RW) {
snprintfcat(flist, sizeof(flist), " RW");
}
Expand Down

0 comments on commit 405834e

Please sign in to comment.