Skip to content
Merged
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
18 changes: 10 additions & 8 deletions modules/test/conn/python/src/connection_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,21 +130,23 @@ def _connection_single_ip(self):

# Extract MAC addresses from DHCP packets
mac_addresses = set()
LOGGER.debug('Inspecting: ' + str(len(packets)) + ' packets')
LOGGER.info('Inspecting: ' + str(len(packets)) + ' packets')
for packet in packets:
# Option[1] = message-type, option 3 = DHCPREQUEST
if DHCP in packet and packet[DHCP].options[0][1] == 3:
mac_address = packet[Ether].src
if not mac_address.startswith(TR_CONTAINER_MAC_PREFIX):
mac_addresses.add(mac_address.upper())
if DHCP in packet:
for option in packet[DHCP].options:
# message-type, option 3 = DHCPREQUEST
if 'message-type' in option and option[1] == 3:
mac_address = packet[Ether].src
LOGGER.info('DHCPREQUEST detected MAC addres: ' + mac_address)
if not mac_address.startswith(TR_CONTAINER_MAC_PREFIX):
mac_addresses.add(mac_address.upper())

# Check if the device mac address is in the list of DHCPREQUESTs
result = self._device_mac.upper() in mac_addresses
LOGGER.debug('DHCPREQUEST detected from device: ' + str(result))
LOGGER.info('DHCPREQUEST detected from device: ' + str(result))

# Check the unique MAC addresses to see if they match the device
for mac_address in mac_addresses:
LOGGER.debug('DHCPREQUEST from MAC address: ' + mac_address)
result &= self._device_mac.upper() == mac_address

if result:
Expand Down
2 changes: 1 addition & 1 deletion modules/test/tls/python/src/tls_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _validate_tls_client(self, client_ip, tls_version):
elif monitor_result[0] and startup_result[0] is None:
result = True, monitor_result[1]
elif startup_result[0] and monitor_result[0] is None:
result = True, monitor_result[1]
result = True, startup_result[1]
else:
result = None, startup_result[1]
return result
Expand Down