- Send a gratuitous ARP packet when our IP address changes

svn path=/trunk/; revision=42455
This commit is contained in:
Cameron Gutman 2009-08-07 03:21:56 +00:00
parent 50eb85ed3b
commit f1b8d48df1
2 changed files with 10 additions and 1 deletions

View file

@ -123,6 +123,11 @@ BOOLEAN ARPTransmit(PIP_ADDRESS Address, PIP_INTERFACE Interface)
TI_DbgPrint(DEBUG_ARP, ("Called.\n"));
/* If Address is NULL then the caller wants an
* gratuitous ARP packet sent */
if (!Address)
Address = &Interface->Unicast;
switch (Address->Type) {
case IP_ADDRESS_V4:
ProtoType = (USHORT)ETYPE_IPv4; /* IPv4 */

View file

@ -222,8 +222,12 @@ VOID IPAddInterfaceRoute( PIP_INTERFACE IF ) {
if (!RouterAddRoute(&NetworkAddress, &IF->Netmask, NCE, 1)) {
TI_DbgPrint(MIN_TRACE, ("Could not add route due to insufficient resources.\n"));
return;
}
/* Send a gratuitous ARP packet to update the route caches of
* other computers */
if (IF != Loopback)
ARPTransmit(NULL, IF);
}
BOOLEAN IPRegisterInterface(