From d1a99727869efcd1969a186393c17eeafa393d65 Mon Sep 17 00:00:00 2001 From: brent s Date: Mon, 18 May 2020 06:21:48 -0400 Subject: [PATCH] D'OH. dumb mistake --- utils/he_ipv6/tpl/dnsmasq.include.j2 | 2 +- utils/he_ipv6/tunnel.py | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/utils/he_ipv6/tpl/dnsmasq.include.j2 b/utils/he_ipv6/tpl/dnsmasq.include.j2 index ecceed6..cd7677a 100644 --- a/utils/he_ipv6/tpl/dnsmasq.include.j2 +++ b/utils/he_ipv6/tpl/dnsmasq.include.j2 @@ -28,7 +28,7 @@ enable-ra {%- do ra_opts.append('ra-names') -%} # {{ assignment.iface }} assignment {%- if do_listen %} -listen = {{ assignment.iface_ll }} +listen-address = {{ assignment.iface_ll }} {%- endif %} ra-param = {{ assignment.iface }}, mtu:{{ common_opts.mtu }}, high, {{ common_opts.min_delay }}, {{ common_opts.lifetime }} {%- if assignment.ra_dhcp %} diff --git a/utils/he_ipv6/tunnel.py b/utils/he_ipv6/tunnel.py index 0535e5a..19da60d 100644 --- a/utils/he_ipv6/tunnel.py +++ b/utils/he_ipv6/tunnel.py @@ -169,15 +169,18 @@ class Tunnel(object): domains = [] do_dhcp = False ra_other = False - tag = _assign_xml.attrib.get('tag', None) - dns = _assign_xml.find('dns') - if dns and self.ra_provider: - do_dns = utils.xml2bool(dns.text.strip()) - domains = [i.strip() for i in dns.attrib.get('domains', '').split() if i.strip() != ''] - dhcp = _assign_xml.find('dhcpv6') - if dhcp and self.ra_provider: - do_dhcp = utils.xml2bool(dhcp.text.strip()) - ra_other = utils.xml2bool(dhcp.attrib.get('advOther', 'false').strip()) + tag = None + _ra_xml = _assign_xml.find('ra') + if _ra_xml is not None and self.ra_provider: + tag = _ra_xml.attrib.get('tag', None) + _dns_xml = _assign_xml.find('dns') + _dhcp_xml = _assign_xml.find('dhcpv6') + if _dns_xml is not None: + do_dns = utils.xml2bool(_dns_xml.text.strip()) + domains = [i.strip() for i in _dns_xml.attrib.get('domains', '').split() if i.strip() != ''] + if _dhcp_xml is not None: + do_dhcp = utils.xml2bool(_dhcp_xml.text.strip()) + ra_other = utils.xml2bool(_dhcp_xml.attrib.get('advOther', 'false').strip()) assign = Assignment(_assign_xml, ra_dns = do_dns, ra_dhcp = do_dhcp,