From a8131113790c0858990eaf4e2fb34f3ab91b99db Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Sat, 31 Mar 2012 21:35:12 +0100 Subject: [PATCH] Fix bug in tag-matching logic with negated tags. --- src/dhcp-common.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dhcp-common.c b/src/dhcp-common.c index 70cb33b..f19a33e 100644 --- a/src/dhcp-common.c +++ b/src/dhcp-common.c @@ -111,6 +111,13 @@ struct dhcp_netid *option_filter(struct dhcp_netid *tags, struct dhcp_netid *con last_tag->next = tags; tagif = run_tag_if(context_tags); + /* reset stuff with tag:! which now matches. */ + for (opt = opts; opt; opt = opt->next) + if (!(opt->flags & (DHOPT_ENCAPSULATE | DHOPT_VENDOR | DHOPT_RFC3925)) && + (opt->flags & DHOPT_TAGOK) && + !match_netid(opt->netid, tagif, 0)) + opt->flags &= ~DHOPT_TAGOK; + for (opt = opts; opt; opt = opt->next) if (!(opt->flags & (DHOPT_ENCAPSULATE | DHOPT_VENDOR | DHOPT_RFC3925 | DHOPT_TAGOK)) && match_netid(opt->netid, tagif, 0))