Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tashrouter/port/localtalk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def broadcast(self, datagram):
def multicast(self, zone_name, datagram):
if self.node == 0: return
log_datagram_multicast(zone_name, datagram, self)
self.send_frame(bytes((0xFF, self.node, self.LLAP_APPLETALK_SHORT_HEADER)) + datagram.as_short_header_bytes())
self.send_frame(bytes((0xFF, self.node, self.LLAP_APPLETALK_LONG_HEADER)) + datagram.as_long_header_bytes())

def _set_network(self, network):
logging.info('%s assigned network number %d', str(self), network)
Expand Down
13 changes: 11 additions & 2 deletions tashrouter/service/name_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class NameInformationService(Service):
NBP_CTRL_FWDREQ = 4

MAX_FIELD_LEN = 32
target_network: int

def __init__(self):
self.thread = None
Expand Down Expand Up @@ -106,9 +107,13 @@ def _run(self, router):
for network in router.zone_information_table.networks_in_zone(zone_field))
entries.discard((None, None))
for entry, _ in entries:
if entry.extended_network:
target_network = 0x0000
else:
target_network = entry.port.network
if entry.distance == 0:
entry.port.multicast(zone_field, Datagram(hop_count=0,
destination_network=0x0000,
destination_network=target_network,
source_network=entry.port.network,
destination_node=0xFF,
source_node=entry.port.node,
Expand All @@ -131,8 +136,12 @@ def _run(self, router):

entry, _ = router.routing_table.get_by_network(datagram.destination_network)
if entry is None or entry.distance != 0: continue # FwdReq thinks we're directly connected to this network but we're not
if entry.extended_network:
target_network = 0x0000
else:
target_network = entry.port.network
entry.port.multicast(zone_field, Datagram(hop_count=0,
destination_network=0x0000,
destination_network=target_network,
source_network=entry.port.network,
destination_node=0xFF,
source_node=entry.port.node,
Expand Down