Fw: ARP table not updated when the MAC address changes for a given IP address
| Newsgroups | gmane.comp.hardware.microcontrollers.tini |
|---|---|
| Message-ID | <OF41DDD7FB.7C254E07-ON85256E3C.00607416-85256E3C.006129AA@spx.com> |
Sumesh wrote:
> I am having same problem,tini is not updating arp cache,i got a high
> availability which will over the ipadress,but tini is not updating arp,
> did you any solution let me know if you find any.
Sumesh,
Yours is the only response I've received.
I've worked around the issue (somewhat) by reading the arp cache prior to
connecting to a host. If the host's address is in the cache, I reboot to
force a purge of the cache.
The reboot is quicker than waiting for the entry to expire (2 minutes).
Also, waiting for the entry to expire wasn't reliable in my case because
there's no guarantee that another connection (such as telnet) won't keep
the entry alive.
Aside from the fact that I'd have a quicker failover time if not for this
issue, rebooting unfortunately terminates all connections.
Whenever I attempt to connect/reconnect to my High Availability Server, I
first do the following:
// reboot if it's in the arp table - works around TINI's
arp cache issue:
try {
byte hostIPv4Addr[] = TININet.stringToIPv4(
hostAddressString );
byte[] ac = TININet.getARPCacheTable();
int count = ac.length /
TININet.ARP_CACHE_ENTRY_LENGTH;
for( int offset = 0; offset < ac.length; offset +=
TININet.ARP_CACHE_ENTRY_LENGTH )
if ( (ac[offset] & 0x01) != 0 &&
ArrayUtils.arrayComp( ac, offset+TININet.ARP_IP_ADDR_OFFS, hostIPv4Addr,
12, 4 ) )
TINIOS.reboot(); // it's in the
arp table - reboot to purge it
} catch(UnknownHostException err ) {
// it can't be in the arp table...
}
Hope this helps,
Andy