Skip to content

get_mac_address() is caching an old mac address, no longer present in local ARP #76

@lucasbritosig

Description

@lucasbritosig

Describe the bug
get_mac_address() is caching an old mac address for a given IP, even when it has timeout from OS ARP table.
Only an explicit delete of the ARP entry on the OS make it return '00:00:00:00:00:00' again.

To Reproduce

  • Force ARP resolution for an IP1 (a device in LAN)
  • Change IP from IP1 to IP2 on the target device.
  • Wait ARP entry timeout (or more)
  • execute get_mac_address(ip=IP1), will still get the device MAC (which is now IP2) instead of '00:00:00:00:00:00'.

OS ARP for IP1:
$ arp 192.168.88.101 -v
Address HWtype HWaddress Flags Mask Iface
192.168.88.101 (incomplete) wlp3s0
Entries: 20 Skipped: 19 Found: 1

Expected behavior
Expects '00:00:00:00:00:00'

System info
(please complete the following information):

  • OS name: Ubuntu
  • OS Version: 20.04.4 LTS focal
  • Python version: 3.8.10 x64

Additional context
Running "arp -d 192.168.88.101" solves the issue.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions