Fixes a bug where the wrong variable was being checked for processing Windows address change notifications. Also adds some logging fixes. (#1313)

This commit is contained in:
Nick Banks
2017-02-13 10:13:31 -08:00
committed by Jonathan Hui
parent 45480ccbb2
commit 3a15494ce4
3 changed files with 35 additions and 16 deletions
@@ -75,5 +75,13 @@
*/
#define OPENTHREAD_CONFIG_LOG_LEVEL OPENTHREAD_LOG_LEVEL_DEBG
/**
* @def OPENTHREAD_CONFIG_LOG_PKT_DUMP
*
* Define to enable log content of packets.
*
*/
#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 0
#endif // OPENTHREAD_CORE_WINDOWS_CONFIG_H_
+14 -7
View File
@@ -251,7 +251,7 @@ otLwfAddressChangeCallback(
// Ignore notifications that aren't for our interface
if (Row->InterfaceIndex != pFilter->InterfaceIndex) return;
LogFuncEntryMsg(DRIVER_DEFAULT, "%p (%u)", pFilter, NotificationType);
LogFuncEntryMsg(DRIVER_DEFAULT, "%p (%u) %!IPV6ADDR!", pFilter, NotificationType, &Row->Address.Ipv6.sin6_addr);
// Since we don't pass in the initial flag, we shouldn't get this type
NT_ASSERT(NotificationType != MibInitialNotification);
@@ -259,12 +259,19 @@ otLwfAddressChangeCallback(
// Make sure we can reference the interface
if (ExAcquireRundownProtection(&pFilter->ExternalRefs))
{
// Queue up the event for processing
otLwfEventProcessingIndicateAddressChange(
pFilter,
NotificationType,
&Row->Address.Ipv6.sin6_addr
);
if (pFilter->DeviceStatus == OTLWF_DEVICE_STATUS_RADIO_MODE)
{
// Queue up the event for processing
otLwfEventProcessingIndicateAddressChange(
pFilter,
NotificationType,
&Row->Address.Ipv6.sin6_addr
);
}
else
{
NT_ASSERT(FALSE); // Need to add support for this in tunnel mode
}
// Release reference on the interface
ExReleaseRundownProtection(&pFilter->ExternalRefs);
@@ -339,15 +339,17 @@ otLwfEventProcessingIndicateAddressChange(
_In_ PIN6_ADDR pAddr
)
{
if (pFilter->DeviceCapabilities == OTLWF_DEVICE_STATUS_RADIO_MODE)
LogFuncEntryMsg(DRIVER_DEFAULT, "Filter: %p", pFilter);
NT_ASSERT(pFilter->DeviceStatus == OTLWF_DEVICE_STATUS_RADIO_MODE);
POTLWF_ADDR_EVENT Event = FILTER_ALLOC_MEM(pFilter->FilterHandle, sizeof(OTLWF_ADDR_EVENT));
if (Event == NULL)
{
LogWarning(DRIVER_DEFAULT, "Failed to alloc new OTLWF_ADDR_EVENT");
}
else
{
POTLWF_ADDR_EVENT Event = FILTER_ALLOC_MEM(pFilter->FilterHandle, sizeof(OTLWF_ADDR_EVENT));
if (Event == NULL)
{
LogWarning(DRIVER_DATA_PATH, "Failed to alloc new OTLWF_ADDR_EVENT");
return;
}
Event->NotificationType = NotificationType;
Event->Address = *pAddr;
@@ -355,10 +357,12 @@ otLwfEventProcessingIndicateAddressChange(
NdisAcquireSpinLock(&pFilter->EventsLock);
InsertTailList(&pFilter->AddressChangesHead, &Event->Link);
NdisReleaseSpinLock(&pFilter->EventsLock);
// Set the event to indicate we have a new address to process
KeSetEvent(&pFilter->EventWorkerThreadProcessAddressChanges, 0, FALSE);
}
LogFuncExit(DRIVER_DEFAULT);
}
// Called to indicate that we have a NetBufferLists to process