diff --git a/RNS/Interfaces/Interface.py b/RNS/Interfaces/Interface.py index 6b1437c5..34f22851 100755 --- a/RNS/Interfaces/Interface.py +++ b/RNS/Interfaces/Interface.py @@ -111,6 +111,7 @@ class Interface: self.bootstrap_only = False self.recursive_prs = False self.announces_from_internal = True + self.announces_to_internal = None self.parent_interface = None self.spawned_interfaces = None self.tunnel_id = None diff --git a/RNS/Reticulum.py b/RNS/Reticulum.py index 1681e44a..d3b346d0 100755 --- a/RNS/Reticulum.py +++ b/RNS/Reticulum.py @@ -811,6 +811,9 @@ class Reticulum: announces_from_internal = True if "announces_from_internal" in c: announces_from_internal = c.as_bool("announces_from_internal") + announces_to_internal = None + if "announces_to_internal" in c: announces_to_internal = c.as_bool("announces_to_internal") + ignore_config_warnings = False if "ignore_config_warnings" in c: ignore_config_warnings = c.as_bool("ignore_config_warnings") @@ -896,6 +899,7 @@ class Reticulum: interface.recursive_prs = recursive_prs interface.announces_from_internal = announces_from_internal + interface.announces_to_internal = announces_to_internal interface.announce_rate_target = announce_rate_target interface.announce_rate_grace = announce_rate_grace interface.announce_rate_penalty = announce_rate_penalty @@ -1052,7 +1056,7 @@ class Reticulum: def _add_interface(self, interface, mode = None, configured_bitrate=None, ifac_size=None, ifac_netname=None, ifac_netkey=None, announce_cap=None, announce_rate_target=None, announce_rate_grace=None, announce_rate_penalty=None, - bootstrap_only=False, recursive_prs=False, announces_from_internal=True): + bootstrap_only=False, recursive_prs=False, announces_from_internal=True, announces_to_internal=None): if not self.is_connected_to_shared_instance: if interface != None and issubclass(type(interface), RNS.Interfaces.Interface.Interface): @@ -1070,6 +1074,7 @@ class Reticulum: interface.recursive_prs = recursive_prs interface.announces_from_internal = announces_from_internal + interface.announces_to_internal = announces_to_internal interface.announce_cap = announce_cap if announce_cap != None else Reticulum.ANNOUNCE_CAP/100.0 interface.announce_rate_target = announce_rate_target interface.announce_rate_grace = announce_rate_grace diff --git a/RNS/Transport.py b/RNS/Transport.py index 7270934c..ff0121b0 100755 --- a/RNS/Transport.py +++ b/RNS/Transport.py @@ -1233,7 +1233,8 @@ class Transport: should_transmit = False RNS.log("Blocking announce broadcast on "+str(interface)+" since next hop interface has no mode configured", ac_loglevel) if RNS.sl(ac_loglevel) else None else: - if from_interface.mode == RNS.Interfaces.Interface.Interface.MODE_BOUNDARY: + if from_interface.announces_to_internal == True: pass + elif from_interface.mode == RNS.Interfaces.Interface.Interface.MODE_BOUNDARY: RNS.log("Blocking announce broadcast on "+str(interface)+" due to boundary-mode next-hop interface", ac_loglevel) if RNS.sl(ac_loglevel) else None should_transmit = False diff --git a/docs/source/interfaces.rst b/docs/source/interfaces.rst index d884dad3..46c0875d 100644 --- a/docs/source/interfaces.rst +++ b/docs/source/interfaces.rst @@ -1274,6 +1274,11 @@ These can be used to control various aspects of interface behaviour. ``internal`` mode interfaces may still be resolvable by means of path requests. + + * | To allow an interface that would *otherwise not* propagate + announces to ``internal`` mode interfaces to do so, you can + configure the ``announces_to_internal`` option to ``True``. + .. _interfaces-modes: Interface Modes