feat(nat): Allow unspecified NAT protocols

This commit is contained in:
v-lafeychine 2023-09-07 21:44:13 +02:00
parent d76b0d2bb4
commit eb3865cb23
Signed by: v-lafeychine
GPG key ID: F46CAAD27C7AB0D5

View file

@ -175,7 +175,7 @@ class SNat(RestrictiveBaseModel):
class Nat(RestrictiveBaseModel):
protocols: set[str] = {"icmp", "udp", "tcp"}
protocols: set[str] | None = {"icmp", "udp", "tcp"}
src: AutoSet[IPv4Network | ZoneName]
dst: AutoSet[IPv4Network | ZoneName]
snat: SNat
@ -573,6 +573,7 @@ def parse_nat(nat: list[Nat], zones: Zones) -> nft.Table:
)
)
if entry.protocols is not None:
rule.stmts.append(
nft.Match(
op="==",