mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Add tag filtering of dhcp-host directives.
This commit is contained in:
14
src/option.c
14
src/option.c
@@ -963,8 +963,7 @@ static char *set_prefix(char *arg)
|
||||
return arg;
|
||||
}
|
||||
|
||||
static struct dhcp_netid *
|
||||
dhcp_netid_create(const char *net, struct dhcp_netid *next)
|
||||
static struct dhcp_netid *dhcp_netid_create(const char *net, struct dhcp_netid *next)
|
||||
{
|
||||
struct dhcp_netid *tt;
|
||||
tt = opt_malloc(sizeof (struct dhcp_netid));
|
||||
@@ -1029,7 +1028,8 @@ static void dhcp_config_free(struct dhcp_config *config)
|
||||
}
|
||||
|
||||
dhcp_netid_list_free(config->netid);
|
||||
|
||||
dhcp_netid_free(config->filter);
|
||||
|
||||
if (config->flags & CONFIG_CLID)
|
||||
free(config->clid);
|
||||
|
||||
@@ -3217,6 +3217,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
|
||||
new->flags = (option == LOPT_BANK) ? CONFIG_BANK : 0;
|
||||
new->hwaddr = NULL;
|
||||
new->netid = NULL;
|
||||
new->filter = NULL;
|
||||
new->clid = NULL;
|
||||
new->addr6 = NULL;
|
||||
|
||||
@@ -3265,11 +3266,8 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
|
||||
newlist->list = dhcp_netid_create(arg+4, NULL);
|
||||
}
|
||||
else if (strstr(arg, "tag:") == arg)
|
||||
{
|
||||
|
||||
dhcp_config_free(new);
|
||||
ret_err(_("cannot match tags in --dhcp-host"));
|
||||
}
|
||||
new->filter = dhcp_netid_create(arg+4, new->filter);
|
||||
|
||||
#ifdef HAVE_DHCP6
|
||||
else if (arg[0] == '[' && arg[strlen(arg)-1] == ']')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user