Two hosts held one address and nothing said so #1473
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1473
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The symptom
Two hosts in one VLAN, both configured
10.0.0.10:Nothing in that output is a lie. Nothing in it is the whole truth either. Two boxes hold the address; the table shows one of them, with the confidence of a row that has no competitor, and the next ping may go to the other one.
Why it happens
The ARP table is keyed by address alone, so
Device.learnArp()overwrote the first answer with the second and the fact went nowhere. The binding is therefore the last reply that arrived — which is why this presents as "the lab is flaky" rather than "the lab has a duplicate address", and why it survives a save, a reload and a fresh run. No view, no log and no event mentioned it.The router is the only place both answers exist, so that is where the fact has to be written down.
The fix
Device.noteArpConflict(ip, mac, port)records an address answered by a second hardware address: both MACs, the port they were heard on. It records nothing when the answer comes from the same MAC (a neighbour refreshing its entry is the ordinary case) and nothing when the second answer arrives on a different port — two subnets may legitimately reuse an address, and manufacturing a conflict out of that would be its own defect.The binding itself is unchanged. The table still holds the most recent answer, because that is what the engine acts on. The note is added beside it, never instead of it.
show ip arpsays it in a sentence, under the table it qualifies:The second line is the part an operator cannot infer from the first — a contested address is not a curiosity, it is traffic that moves.
The clash travels with the row:
Device.arpRows()carriesconflict, so a panel reading the same data cannot present the address as settled, and anarp-conflictevent goes on the wire ({type:'arp-conflict', dev, iface, ip, macs, vlan}) for the packet view.Deliberately not done
The two hosts themselves stay quiet. A real stack detects a duplicate address from the other box's ARP claim and logs
%IP-4-DUPADDR; modelling that is a new protocol behaviour rather than a view telling the truth about data it already had, so it is left as a decision instead of being smuggled in with this fix.Evidence
Neighbours green:
show-arp28,arp-ageing31,runtime-agreement10,show-argument-refusal77,show-ip-spellings70,dhcp-bindings51,lldp27,vrrp94,ping-ipv643. Syntax 303 files OK. Full suite: 235 suites, 8809 assertions, 0 failed.Landed as #1474 (
5aca4f5a). Post-merge onmain:arp-conflict26,show-arp28,arp-ageing31, tree clean.show ip arpnow ends a contested entry with the sentence and the consequence:and
arpRows()carries the conflict, so the UI cannot render that address as settled either. The detection sits in the single funnel every ARP learn passes through, so no code path can update the table privately and miss a clash.