- Merge aicom-network-fixes up to r38730

svn path=/trunk/; revision=38743
This commit is contained in:
Cameron Gutman 2009-01-13 02:34:39 +00:00
parent 9452b7e23c
commit 71f5b95706
2 changed files with 17 additions and 15 deletions

View file

@ -1553,6 +1553,7 @@ NTSTATUS DispTdiSetIPAddress( PIRP Irp, PIO_STACK_LOCATION IrpSp ) {
IF->Unicast.Address.IPv4Address = IpAddrChange->Address; IF->Unicast.Address.IPv4Address = IpAddrChange->Address;
IF->Netmask.Type = IP_ADDRESS_V4; IF->Netmask.Type = IP_ADDRESS_V4;
IF->Netmask.Address.IPv4Address = IpAddrChange->Netmask; IF->Netmask.Address.IPv4Address = IpAddrChange->Netmask;
IF->Broadcast.Type = IP_ADDRESS_V4;
IF->Broadcast.Address.IPv4Address = IF->Broadcast.Address.IPv4Address =
IF->Unicast.Address.IPv4Address | IF->Unicast.Address.IPv4Address |
~IF->Netmask.Address.IPv4Address; ~IF->Netmask.Address.IPv4Address;
@ -1587,6 +1588,8 @@ NTSTATUS DispTdiDeleteIPAddress( PIRP Irp, PIO_STACK_LOCATION IrpSp ) {
IF->Unicast.Address.IPv4Address = 0; IF->Unicast.Address.IPv4Address = 0;
IF->Netmask.Type = IP_ADDRESS_V4; IF->Netmask.Type = IP_ADDRESS_V4;
IF->Netmask.Address.IPv4Address = 0; IF->Netmask.Address.IPv4Address = 0;
IF->Broadcast.Type = IP_ADDRESS_V4;
IF->Broadcast.Address.IPv4Address = 0;
Status = STATUS_SUCCESS; Status = STATUS_SUCCESS;
} }
} EndFor(IF); } EndFor(IF);

View file

@ -147,7 +147,8 @@ VOID IPDispatchProtocol(
TI_DbgPrint(MIN_TRACE, ("IPv6 datagram discarded.\n")); TI_DbgPrint(MIN_TRACE, ("IPv6 datagram discarded.\n"));
return; return;
default: default:
Protocol = 0; TI_DbgPrint(MIN_TRACE, ("Unrecognized datagram discarded.\n"));
return;
} }
if (Protocol < IP_PROTOCOL_TABLE_SIZE) if (Protocol < IP_PROTOCOL_TABLE_SIZE)
@ -308,22 +309,20 @@ VOID IPRemoveInterfaceRoute( PIP_INTERFACE IF ) {
PNEIGHBOR_CACHE_ENTRY NCE; PNEIGHBOR_CACHE_ENTRY NCE;
IP_ADDRESS GeneralRoute; IP_ADDRESS GeneralRoute;
TCPDisposeInterfaceData( IF->TCPContext );
IF->TCPContext = NULL;
TI_DbgPrint(DEBUG_IP,("Removing interface Addr %s\n", A2S(&IF->Unicast)));
TI_DbgPrint(DEBUG_IP,(" Mask %s\n", A2S(&IF->Netmask)));
AddrWidenAddress(&GeneralRoute,&IF->Unicast,&IF->Netmask);
RouterRemoveRoute(&GeneralRoute, &IF->Unicast);
/* Remove permanent NCE, but first we have to find it */
NCE = NBLocateNeighbor(&IF->Unicast); NCE = NBLocateNeighbor(&IF->Unicast);
if (NCE) if (NCE)
NBRemoveNeighbor(NCE); {
else TCPDisposeInterfaceData( IF->TCPContext );
TI_DbgPrint(DEBUG_IP, ("Could not delete IF route (0x%X)\n", IF));
TI_DbgPrint(DEBUG_IP,("Removing interface Addr %s\n", A2S(&IF->Unicast)));
TI_DbgPrint(DEBUG_IP,(" Mask %s\n", A2S(&IF->Netmask)));
AddrWidenAddress(&GeneralRoute,&IF->Unicast,&IF->Netmask);
RouterRemoveRoute(&GeneralRoute, &IF->Unicast);
NBRemoveNeighbor(NCE);
}
} }
VOID IPUnregisterInterface( VOID IPUnregisterInterface(