~martijnbraam/ofonoctl

[PATCH 2/2] add IPv6 DNS servers even when method is not static

Details
Message ID
<3T1rOIf9L4BNPghZg0PjQ3BdqIva_0_7Evf11S8VbIbTj20_XvSIrsBIzxsqa9AWPgFMBYQmbfEoXOP7Nwm1xB6IeGPMKBQIRhF6-8d_-UQ=@protonmail.com>
DKIM signature
pass
Download raw message
Patch: +6 -7
From: anteater <nt8r@protonmail.com>

---
 ofonoctl/__init__.py | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/ofonoctl/__init__.py b/ofonoctl/__init__.py
index 52be47a..836c3af 100644
--- a/ofonoctl/__init__.py
+++ b/ofonoctl/__init__.py
@@ -221,7 +221,7 @@ def action_wan(connect=False, resolv=False):
            if s["Method"] == "static":
                dns_servers += s["DomainNameServers"]

        if "Method" in settings6:
        if "Address" in settings6:
            s = settings6

            if connect and not has_flushed:
@@ -229,13 +229,12 @@ def action_wan(connect=False, resolv=False):
                subprocess.check_output(cmd)
                has_flushed = True

            address = s["Address"] if s["Method"] == "static" else ""
            gateway = s["Gateway"] if s["Method"] == "static" else ""
            dns = ", ".join(s["DomainNameServers"]) if s["Method"] == "static" else ""
            result.append([s["Interface"], "ipv6", properties["AccessPointName"], s["Method"], address, gateway, dns])
            address = s["Address"]
            gateway = s["Gateway"]
            dns = ", ".join(s["DomainNameServers"])
            result.append([s["Interface"], "ipv6", properties["AccessPointName"], "", address, gateway, dns])

            if s["Method"] == "static":
                dns_servers += s["DomainNameServers"]
            dns_servers += s["DomainNameServers"]

        if resolv:
            update_resolvconf(dns_servers)
--
2.28.0
Reply to thread Export thread (mbox)