nftables: allow names the outward link a kept allowance opens

An allowance with no interface never opens an outward link; one named in
interfaces does, and allow now says so: a kept allowance whose interface is
in the outward links of the converged answer asked for the call answers
with outward, that link. The holder reads no shape of the loaded table to
tell an outward link from the tunnel; the event carries no outward.

Builds: design 33 control-verbs §4, §14; design 47 H H-A-324, H-A-325
This commit is contained in:
2026-11-21 21:19:03 +01:00
parent 09d5758343
commit 38ea9ce25c
2 changed files with 29 additions and 6 deletions
+11
View File
@@ -79,6 +79,17 @@ test("allow keeps one key per interface, and with none the default set's key, wh
}
});
test("allow naming an outward link answers it as outward, as converged lists them; another interface and the default set do not (H-A-325)", async () => {
const { a, asks, said } = fake();
asks.convergence = { state: "converged", since: "2026-11-01T00:00:00Z", tunnel: "mesh0", outward: ["eth1"] };
const named = await a.allow({ port: 8000, interfaces: ["eth1", "enp6s0"], why: "w" }, "lead@shanks");
assert.deepEqual(named.allowances.map((x) => [x.key, x.outward]), [["allow.tcp.8000.eth1", "eth1"], ["allow.tcp.8000.enp6s0", undefined]]);
assert.equal("outward" in named.allowances[1], false, "an interface that is no outward link answers without the field");
const none = await a.allow({ port: 8001, why: "w" }, "lead@shanks");
assert.equal("outward" in none.allowances[0], false, "the default set opens no outward link");
assert.equal(said.flatMap((b) => b.allowances).some((x) => "outward" in x), false, "the event's allowances carry no outward");
});
test("allow and disallow refuse what is not an allowance, writing nothing", async () => {
const bad: [string, Record<string, unknown>, RegExp][] = [
["port 0", { port: 0, why: "w" }, /port: /],