Fix regression: functions containing domain (ip ip6)
commit392e586a3a0e8d49b89661380c8404a690913cad
authorFaidon Liambotis <paravoid@debian.org>
Wed, 31 Oct 2012 18:05:21 +0000 (31 20:05 +0200)
committerMax Kellermann <max@duempel.org>
Wed, 21 Nov 2012 16:08:19 +0000 (21 17:08 +0100)
tree5324a95089fb8d51a75ce760af132316f0389c09
parent1a02ef97ec689ffb573a89378624241387f1ebb4
Fix regression: functions containing domain (ip ip6)

Commit 729e3e introduced support for individual evaluation of rules
per-domain. As part of that, inside a domain statement, execution forks
into two inner rules and then individually executed.

However, the inner rule is entered starting with level $lev, which can
never be zeroed back, since its contents are collected via a call to
collect_tokens(), which is a zero-summed collection.

This worked on most cases, since domain is usually defined on level
zero. A notable exception is when domain (ip ip6) is defined inside a
function.

Fix this by entering the inner rule with an initial zero level and add a
test case to the test suite. This is a fix for a ferm 2.1 regression.
NEWS
src/ferm
test/ipv6/mixed.ferm
test/ipv6/mixed.result