diff --git a/src/primaite/simulator/network/hardware/nodes/network/router.py b/src/primaite/simulator/network/hardware/nodes/network/router.py index e86b1843..8cdf3f86 100644 --- a/src/primaite/simulator/network/hardware/nodes/network/router.py +++ b/src/primaite/simulator/network/hardware/nodes/network/router.py @@ -1371,7 +1371,7 @@ class Router(NetworkNode): def subject_to_acl(self, frame: Frame) -> bool: """Check that frame is subject to ACL rules.""" - if frame.ip.protocol == IPProtocol.UDP and frame.udp.dst_port == Port.ARP: + if frame.ip.protocol == IPProtocol.UDP and frame.is_arp: return False return True @@ -1388,9 +1388,6 @@ class Router(NetworkNode): if self.operating_state != NodeOperatingState.ON: return - print("£££££££££££££££££££££££££££££") - print(f"Frame received is: {frame}") - if self.subject_to_acl(frame=frame): # Check if it's permitted permitted, rule = self.acl.is_permitted(frame) diff --git a/src/primaite/simulator/network/transmission/data_link_layer.py b/src/primaite/simulator/network/transmission/data_link_layer.py index 9d8a0a1c..86a6038b 100644 --- a/src/primaite/simulator/network/transmission/data_link_layer.py +++ b/src/primaite/simulator/network/transmission/data_link_layer.py @@ -161,11 +161,11 @@ class Frame(BaseModel): """ Checks if the Frame is an ARP (Address Resolution Protocol) packet. - This is determined by checking if the destination port of the UDP header is equal to the ARP port. + This is determined by checking if the destination and source port of the UDP header is equal to the ARP port. :return: True if the Frame is an ARP packet, otherwise False. """ - return self.udp.dst_port == Port.ARP + return self.udp.dst_port == Port.ARP and self.udp.src_port == Port.ARP @property def is_icmp(self) -> bool: