Skip to content

Commit 5c74156

Browse files
committed
Reject packets with source of 0.0 from extended networks.
Packets from extended networks must have a source network specified. Anything coming from node `0.0` is clearly invalid and should be discarded. Note that the Linux 6.9 and newer include a revised AppleTalk kernel module that sometimes outputs packets with a source of `0.0`, which was causing TashRouter to crash. Fixes #8
1 parent 95dacac commit 5c74156

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tashrouter/router/router.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ def stop(self):
7171

7272
def inbound(self, datagram, rx_port):
7373
'''Called by a Port when a Datagram comes in from that port. The Datagram may be routed, delivered, both, or neither.'''
74+
# if we receive a packet from source node 0.0 on an extended network, discard it
75+
if datagram.source_network == 0x0000 and datagram.source_node == 0x00 and rx_port.extended_network == True:
76+
return
7477

7578
# a network number of zero means "this network", but we know what that is from the port, so sub it in
7679
# note that short-header Datagrams always have a network number of zero

0 commit comments

Comments
 (0)