From: Felix Fietkau Date: Sun, 22 Dec 2024 18:19:25 +0000 (+0100) Subject: service: add default group @ to match all nodes X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3225004036159d6645be30258f6dccf9bedf81ac;p=project%2Funetd.git service: add default group @ to match all nodes Simplifies handling services that should be enabled globally Signed-off-by: Felix Fietkau --- diff --git a/service.c b/service.c index 73cf5b8..5237915 100644 --- a/service.c +++ b/service.c @@ -54,6 +54,7 @@ __service_parse_members(struct network *net, struct network_service *s, { struct network_group *group; struct network_host *host; + unsigned int count = 0; if (name[0] != '@') { host = avl_find_element(&net->hosts, name, host, node); @@ -68,6 +69,15 @@ __service_parse_members(struct network *net, struct network_service *s, } name++; + if (!name[0]) { + avl_for_each_element(&net->hosts, host, node) { + if (s) + __service_add_member(s->members, &s->n_members, host); + count++; + } + return count; + } + group = avl_find_element(&net->groups, name, group, node); if (!group) return 0;