Skip to content

Commit

Permalink
Fix #492: default value -1 not used for 'ttl' setting
Browse files Browse the repository at this point in the history
The plugins check for ttl >= 0 to see if a user has set a value.  With
the `CFGF_NODEFAULT` flag libConfuse ignores the default (-1) and will
always return zero (0) instead.

Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Aug 21, 2024
1 parent b9edfbf commit e8d07b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ cfg_t *conf_parse_file(char *file, ddns_t *ctx)
CFG_STR_LIST("alias", NULL, CFGF_DEPRECATED),
CFG_BOOL ("ssl", cfg_true, CFGF_NONE),
CFG_BOOL ("wildcard", cfg_false, CFGF_NONE),
CFG_INT ("ttl", -1, CFGF_NODEFAULT),
CFG_INT ("ttl", -1, CFGF_NONE),
CFG_BOOL ("proxied", cfg_false, CFGF_NONE),
CFG_STR ("iface", NULL, CFGF_NONE), /* interface name */
CFG_STR ("checkip-server", NULL, CFGF_NONE), /* Syntax: name:port */
Expand All @@ -564,7 +564,7 @@ cfg_t *conf_parse_file(char *file, ddns_t *ctx)
CFG_STR_LIST("alias", NULL, CFGF_DEPRECATED),
CFG_BOOL ("ssl", cfg_true, CFGF_NONE),
CFG_BOOL ("wildcard", cfg_false, CFGF_NONE),
CFG_INT ("ttl", -1, CFGF_NODEFAULT),
CFG_INT ("ttl", -1, CFGF_NONE),
CFG_BOOL ("proxied", cfg_false, CFGF_NONE),
CFG_STR ("iface", NULL, CFGF_NONE), /* interface name */
CFG_STR ("checkip-server", NULL, CFGF_NONE), /* Syntax: name:port */
Expand Down

0 comments on commit e8d07b5

Please sign in to comment.