mirror of
https://github.com/markqvist/Reticulum.git
synced 2026-07-23 08:18:11 -07:00
Added detection of yggdrasil addresses to auto-connect handler
This commit is contained in:
@@ -636,6 +636,10 @@ class InterfaceDiscovery():
|
|||||||
RNS.log(f"You can obtain the configuration entry and add this interface manually instead using rnstatus -D", RNS.LOG_WARNING)
|
RNS.log(f"You can obtain the configuration entry and add this interface manually instead using rnstatus -D", RNS.LOG_WARNING)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if is_ygg_ipv6(info["reachable_on"]):
|
||||||
|
# TODO: Somehow detect if yggdrasil is enabled on the system
|
||||||
|
return
|
||||||
|
|
||||||
interface_name = info["name"]
|
interface_name = info["name"]
|
||||||
config_entry = info["config_entry"]
|
config_entry = info["config_entry"]
|
||||||
interface_config = {}
|
interface_config = {}
|
||||||
@@ -757,6 +761,10 @@ def is_ip_address(address_string):
|
|||||||
return True
|
return True
|
||||||
except: return False
|
except: return False
|
||||||
|
|
||||||
|
def is_ygg_ipv6(address_string):
|
||||||
|
try: return ipaddress.ip_address(address_string) in ipaddress.IPv6Network("200::/7")
|
||||||
|
except: return False
|
||||||
|
|
||||||
def is_hostname(hostname):
|
def is_hostname(hostname):
|
||||||
if hostname[-1] == ".": hostname = hostname[:-1]
|
if hostname[-1] == ".": hostname = hostname[:-1]
|
||||||
if len(hostname) > 253: return False
|
if len(hostname) > 253: return False
|
||||||
|
|||||||
Reference in New Issue
Block a user