Skip to content

Commit

Permalink
Use correct param order for NPF_UpdateTimestampModeCounts. Fixes #668
Browse files Browse the repository at this point in the history
  • Loading branch information
dmiller-nmap committed Apr 24, 2023
1 parent 9703a0f commit 2e7fc75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packetWin7/npf/npf/Openclos.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ NPF_StartUsingOpenInstance(
// Get the absolute value of the system boot time.
// This is used for timestamp conversion.
TIME_SYNCHRONIZE(&pOpen->start);
NPF_UpdateTimestampModeCounts(pOpen->pFiltMod, TIMESTAMPMODE_UNSET, pOpen->TimestampMode);
NPF_UpdateTimestampModeCounts(pOpen->pFiltMod, pOpen->TimestampMode, TIMESTAMPMODE_UNSET);

pOpen->OpenStatus = OpenRunning;
}
Expand Down Expand Up @@ -705,7 +705,7 @@ NPF_DemoteOpenStatus(
INFO_DBG("Open %p: %d -> %d\n", pOpen, OldState, NewState);
if (OldState == OpenRunning)
{
NPF_UpdateTimestampModeCounts(pOpen->pFiltMod, pOpen->TimestampMode, TIMESTAMPMODE_UNSET);
NPF_UpdateTimestampModeCounts(pOpen->pFiltMod, TIMESTAMPMODE_UNSET, pOpen->TimestampMode);
}
pOpen->ReattachStatus = NewState;

Expand Down Expand Up @@ -2134,7 +2134,7 @@ NPF_AttachAdapter(
NPF_AddToGroupOpenArray(pOpen, pFiltMod, 0);
if (pOpen->ReattachStatus < OpenAttached)
{
NPF_UpdateTimestampModeCounts(pFiltMod, TIMESTAMPMODE_UNSET, pOpen->TimestampMode);
NPF_UpdateTimestampModeCounts(pFiltMod, pOpen->TimestampMode, TIMESTAMPMODE_UNSET);
pOpen->OpenStatus = pOpen->ReattachStatus;
}
Curr = PopEntryList(&ReattachOpens);
Expand Down Expand Up @@ -3357,7 +3357,7 @@ NDIS_STATUS NPF_DoInternalRequest(
return Status;
}

_Use_decl_annotations_
_Use_decl_annotations_
VOID NPF_UpdateTimestampModeCounts(
PNPCAP_FILTER_MODULE pFiltMod,
ULONG newmode,
Expand Down
1 change: 1 addition & 0 deletions packetWin7/npf/npf/Read.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ NPF_Read(
}

header = (struct bpf_hdr *) (packp + copied);
NT_ASSERT(header->bh_tstamp.tv_sec > 0 || header->bh_tstamp.tv_usec > 0);
switch (Open->TimestampMode)
{
case TIMESTAMPMODE_QUERYSYSTEMTIME:
Expand Down

0 comments on commit 2e7fc75

Please sign in to comment.