When we have a published ARP entry for some IP address, do reply on

ARP requests only on the network where this IP address belong, to.

Before this change we did replied on all interfaces. This could
lead to an IP address conflict with host we are doing ARP proxy
for.

PR:		kern/75634
Reviewed by:	andre
This commit is contained in:
Gleb Smirnoff 2005-08-25 13:25:57 +00:00
parent b3130703e6
commit 510b360fc0

View File

@ -851,6 +851,15 @@ in_arpinput(m)
inet_ntoa(itaddr));
#endif
} else {
/*
* Return proxied ARP replies only on the interface
* where this network resides. Otherwise we may
* conflict with the host we are proxying for.
*/
if (rt->rt_ifp != ifp) {
RT_UNLOCK(rt);
goto drop;
}
sdl = SDL(rt->rt_gateway);
(void)memcpy(ar_tha(ah), ar_sha(ah), ah->ar_hln);
(void)memcpy(ar_sha(ah), LLADDR(sdl), ah->ar_hln);