Skip to content

Commit

Permalink
drivers/main.c: comment about immutable (or not) driver/default/overr…
Browse files Browse the repository at this point in the history
…ide dstate values [networkupstools#266]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Jul 22, 2024
1 parent cd81e18 commit bf18c23
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ void dparam_setinfo(const char *var, const char *val)
{
char vtmp[SMALLBUF];

/* store these in dstate for debugging and other help */
/* store these in dstate for debugging and other help
* note these are not immutable since we can reload
*/
if (val) {
snprintf(vtmp, sizeof(vtmp), "driver.parameter.%s", var);
dstate_setinfo(vtmp, "%s", val);
Expand Down Expand Up @@ -304,6 +306,10 @@ void storeval(const char *var, char *val)
/* NOTE: No regard for VAR_SENSITIVE here */
dstate_setinfo(var+9, "%s", val);
dstate_setflags(var+9, ST_FLAG_IMMUTABLE);

/* note these are not immutable since we can reload
* although the effect of this is questionable (FIXME)
*/
dparam_setinfo(var, val);
return;
}
Expand Down

0 comments on commit bf18c23

Please sign in to comment.