From a89462e227109ca383060a5afa258415b0ee5338 Mon Sep 17 00:00:00 2001 From: Jacob Boddey Date: Thu, 4 Apr 2024 10:40:36 +0100 Subject: [PATCH 1/2] Allow ARP from 0.0.0.0 --- modules/test/conn/python/src/connection_module.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/test/conn/python/src/connection_module.py b/modules/test/conn/python/src/connection_module.py index e0c7f1d1a..2111a1c89 100644 --- a/modules/test/conn/python/src/connection_module.py +++ b/modules/test/conn/python/src/connection_module.py @@ -105,10 +105,11 @@ def _connection_switch_arp_inspection(self): # Check MAC address matches IP address if (arp_packet.hwsrc == self._device_mac and - arp_packet.psrc != self._device_ipv4_addr): + (arp_packet.psrc != self._device_ipv4_addr + or arp_packet.psrc != '0.0.0.0')): LOGGER.info(f'Bad ARP packet detected for MAC: {self._device_mac}') - LOGGER.info(f'''ARP packet from IP {arp_packet.psrc} does not match - {self._device_ipv4_addr}''') + LOGGER.info(f'''ARP packet from IP {arp_packet.psrc} + does not match {self._device_ipv4_addr}''') return False, 'Device is sending false ARP response' if no_arp: From 6186938b08ddd5b122b2c73909ba1bd3d616bcf8 Mon Sep 17 00:00:00 2001 From: Jacob Boddey Date: Thu, 4 Apr 2024 13:27:35 +0100 Subject: [PATCH 2/2] Fix logic --- modules/test/conn/python/src/connection_module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/test/conn/python/src/connection_module.py b/modules/test/conn/python/src/connection_module.py index 2111a1c89..cf8852ef0 100644 --- a/modules/test/conn/python/src/connection_module.py +++ b/modules/test/conn/python/src/connection_module.py @@ -106,7 +106,7 @@ def _connection_switch_arp_inspection(self): # Check MAC address matches IP address if (arp_packet.hwsrc == self._device_mac and (arp_packet.psrc != self._device_ipv4_addr - or arp_packet.psrc != '0.0.0.0')): + and arp_packet.psrc != '0.0.0.0')): LOGGER.info(f'Bad ARP packet detected for MAC: {self._device_mac}') LOGGER.info(f'''ARP packet from IP {arp_packet.psrc} does not match {self._device_ipv4_addr}''')