Skip to content

Commit 385b4ab

Browse files
author
3np
committed
perf(network-agent): use cycle instead of manually doubling nameserver list for zip
1 parent ad07468 commit 385b4ab

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

network/qubes-setup-dnat-to-ns

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
from __future__ import annotations
2323

24+
from itertools import cycle
2425
import subprocess
2526
import sys
2627

@@ -116,10 +117,7 @@ def install_firewall_rules(dns):
116117
f"ip daddr {vm_nameserver} tcp dport 53 drop",
117118
]
118119
else:
119-
while len(qubesdb_dns) > len(dns_resolved):
120-
# Ensure that upstream DNS pool is larger than qubesdb_dns pool
121-
dns_resolved = dns_resolved + dns_resolved
122-
for vm_nameserver, dest in zip(qubesdb_dns, dns_resolved):
120+
for vm_nameserver, dest in zip(qubesdb_dns, cycle(dns_resolved)):
123121
dns_ = str(dest)
124122
rules += [
125123
f"ip daddr {vm_nameserver} udp dport 53 dnat to {dns_}",

0 commit comments

Comments
 (0)