Skip to content

Commit

Permalink
Merge pull request #2168 from pi-hole/tweak/nlinks
Browse files Browse the repository at this point in the history
Netlink tweaks
  • Loading branch information
DL6ER authored Jan 29, 2025
2 parents e080884 + 6e3beba commit c7d3b8f
Show file tree
Hide file tree
Showing 8 changed files with 205 additions and 55 deletions.
3 changes: 3 additions & 0 deletions src/api/docs/content/specs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,8 @@ components:
type: boolean
ntp:
type: boolean
netlink:
type: boolean
all:
type: boolean
topics:
Expand Down Expand Up @@ -825,6 +827,7 @@ components:
extra: false
reserved: false
ntp: false
netlink: false
all: false
config_one:
summary: One option
Expand Down
6 changes: 6 additions & 0 deletions src/config/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,12 @@ static void initConfig(struct config *conf)
conf->debug.ntp.d.b = false;
conf->debug.ntp.c = validate_stub; // Only type-based checking

conf->debug.netlink.k = "debug.netlink";
conf->debug.netlink.h = "Print information about netlink communication and parsing";
conf->debug.netlink.t = CONF_BOOL;
conf->debug.netlink.d.b = false;
conf->debug.netlink.c = validate_stub; // Only type-based checking

conf->debug.all.k = "debug.all";
conf->debug.all.h = "Set all debug flags at once. This is a convenience option to enable all debug flags at once. Note that this option is not persistent, setting it to true will enable all *remaining* debug flags but unsetting it will disable *all* debug flags.";
conf->debug.all.t = CONF_ALL_DEBUG_BOOL;
Expand Down
1 change: 1 addition & 0 deletions src/config/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ struct config {
struct conf_item extra;
struct conf_item reserved;
struct conf_item ntp;
struct conf_item netlink;
// all must be the last item in this struct
struct conf_item all;
} debug;
Expand Down
1 change: 1 addition & 0 deletions src/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ enum debug_flag {
DEBUG_EXTRA,
DEBUG_RESERVED,
DEBUG_NTP,
DEBUG_NETLINK,
DEBUG_MAX
} __attribute__ ((packed));

Expand Down
2 changes: 2 additions & 0 deletions src/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ const char *debugstr(const enum debug_flag flag)
return "DEBUG_RESERVED";
case DEBUG_NTP:
return "DEBUG_NTP";
case DEBUG_NETLINK:
return "DEBUG_NETLINK";
case DEBUG_MAX:
return "DEBUG_MAX";
case DEBUG_NONE: // fall through
Expand Down
Loading

0 comments on commit c7d3b8f

Please sign in to comment.