Commit cc0192a3 authored by Ales Mrazek's avatar Ales Mrazek

do-ip4/6 correction

parent 485f9643
......@@ -12,8 +12,8 @@ unbound_regex = {
'rz-file': compile(r'^\sroot-hints:\s"(?P<rz_file>.*)"\n'), # yes
'interface': compile(r'interface:\s(?P<adress>.*)@(?P<port>\d+)\n'), # yes
'outgoing-interface': compile(r'outgoing-interface:\s(?P<out_interface>.*)\n'), # yes
'do-ip4': compile(r'do-ip4\s=\s(?P<do_ipv4>yes|no)\n'), # yes
'do-ip6': compile(r'do-ip6\s=\s(?P<do_ipv6>yes|no)\n'), # yes
'do-ip4': compile(r'do-ip4\s:\s(?P<do_ipv4>yes|no)\n'), # yes
'do-ip6': compile(r'do-ip6\s:\s(?P<do_ipv6>yes|no)\n'), # yes
'edns-buffer-size': compile(r'edns-buffer-size:\s(?P<edns_bsize>\d+)\n'), # yes
'harden-glue': compile(r'harden-glue:\s(?P<harden_glue>yes|no)\n'), # yes
'qname-minimisation': compile(r'qname-minimisation:\s(?P<qname_min>yes|no)\n'), # yes
......
......@@ -60,14 +60,14 @@ def gen_unbound(data: dict):
protocols = str(data['network']['recursion-transport']['l2-protocols'].value)
if 'ipv4' in protocols:
if 'ipv6' in protocols:
server += str("\tdo-ip6 = yes\n\tdo-ip4 = yes\n")
server += str("\tdo-ip6: yes\n\tdo-ip4: yes\n")
else:
server += str("\tdo-ip6 = no\n\tdo-ip4 = yes\n")
server += str("\tdo-ip6: no\n\tdo-ip4: yes\n")
else:
if 'ipv6' in protocols:
server += str("\tdo-ip6 = yes\n\tdo-ip4 = no\n")
server += str("\tdo-ip6: yes\n\tdo-ip4: no\n")
else:
server += str("\tdo-ip6 = no\n\tdo-ip4 = no\n")
server += str("\tdo-ip6: no\n\tdo-ip4: no\n")
if 'udp-payload-size' in data['network']:
server += "\tedns-buffer-size: {}\n".format(str(data['network']['udp-payload-size'].value))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment