1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Filter: Add literal for empty set

Add literal for empty set [], which works both for tree-based sets
and prefix sets by using existing constant promotion mechanism.

Minor changes by committer.
This commit is contained in:
Alexander Zubkov
2022-03-04 14:07:58 +01:00
committed by Ondrej Zajicek
parent 8f3c6151b4
commit b2d6d2948a
6 changed files with 90 additions and 5 deletions

View File

@@ -501,6 +501,11 @@ f_const_promotion(struct f_inst *arg, enum f_type want)
return 1;
}
else if ((c->type == T_SET) && (!c->val.t) && (want == T_PREFIX_SET)) {
*c = f_const_empty_prefix_set;
return 1;
}
return 0;
}