@mkx, how exactly MikroTIK finds that this IP is indeed in use ?
Not sure how mikrotik determines that IP address is already in use. In theory it should consult its own ARP tables and only answer the query when it finds entry exactly matching the target IP address and device is residing behind interface other than the one which received ARP whohas query. Which likely means that proxy-arp sometimes doesn't answer for mostly-silent destination addresses where ARP entry time-outs.
Address occupancy check procedure:
- get IP address (either using APIPA or via DHCP lease)
- ask if somebody is already using it by sending broadcast message ARP who has
- if somebody answers claiming it's using it, this means address is already in use.
Repeat from bullet #1
- if nobody answers, this means IP address is free.
Configure IP stack and get done with it.
Details about how to perform bullet #2 are different depending on how IP address was obtained, APIPA procedure is defined in
RFC3927.
What are chances for another device on network to have same APIPA address? Not entirely impossible because chosen APIPA address is supposed to be chosen randomly ... if devices use same random generator and end up using same salt, they come up with same address. If APIPA address selection is done properly, then chances of address conflict are slim.
Yes, router should only reply with own MAC address to ARP whohas queries only if it knows that device with target IP address is indeed behind another router's interface. I guess there's room for bugs here
But then, IMHO, IPv4 link-local addresses only have to be unique within same L2 subnet. The fact that proxy-arp is configured indicates that there is more than a single L2 network involved (or that whoever set it didn't exactly know what he was doing).