Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions pkg/plugin/ebpfwindows/ebpf_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,8 @@
t.Errorf("expected event type %v, got %v", MessageTypePktmonDrop, eventType)
}

var testDropReason int32 = 1001
var testDropReason int32 = 2
testDropReason = testDropReason | (1 << 30)

Check failure on line 776 in pkg/plugin/ebpfwindows/ebpf_windows_test.go

View workflow job for this annotation

GitHub Actions / Lint (windows, arm64)

assignOp: replace `testDropReason = testDropReason | (1 << 30)` with `testDropReason |= (1 << 30)` (gocritic)

Check failure on line 776 in pkg/plugin/ebpfwindows/ebpf_windows_test.go

View workflow job for this annotation

GitHub Actions / Lint (windows, amd64)

assignOp: replace `testDropReason = testDropReason | (1 << 30)` with `testDropReason |= (1 << 30)` (gocritic)
eventSubType := fl.GetEventType().GetSubType()
if eventSubType != testDropReason {
t.Errorf("expected event type %v, got %v", testDropReason, eventSubType)
Expand Down Expand Up @@ -817,9 +818,9 @@
pdn[31] = 0x01
pdn[32] = 0x00

// DropReason 0x000003E9
pdn[39] = 0xE9
pdn[40] = 0x03
// DropReason 0x00000002
pdn[39] = 0x02
pdn[40] = 0x00
pdn[41] = 0x00
pdn[42] = 0x00
var buf bytes.Buffer
Expand Down Expand Up @@ -860,6 +861,7 @@
}

var testDropReason int32 = 2
testDropReason = testDropReason | (1 << 30)

Check failure on line 864 in pkg/plugin/ebpfwindows/ebpf_windows_test.go

View workflow job for this annotation

GitHub Actions / Lint (windows, arm64)

assignOp: replace `testDropReason = testDropReason | (1 << 30)` with `testDropReason |= (1 << 30)` (gocritic)

Check failure on line 864 in pkg/plugin/ebpfwindows/ebpf_windows_test.go

View workflow job for this annotation

GitHub Actions / Lint (windows, amd64)

assignOp: replace `testDropReason = testDropReason | (1 << 30)` with `testDropReason |= (1 << 30)` (gocritic)
eventSubType := fl.GetEventType().GetSubType()
if eventSubType != testDropReason {
t.Errorf("expected event type %v, got %v", testDropReason, eventSubType)
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugin/ebpfwindows/parser_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func (p *Parser) decode(data []byte, decoded *pb.Flow) error {
// Fill relevant fields for dropNotify from pktmonNotify struct
dn = &DropNotify{}

eventSubType = pdn.PktmonHeader.Metadata.DropReason + 1000
eventSubType = pdn.PktmonHeader.Metadata.DropReason | (1 << 30)
if offset > uint(MaxInt) {
return fmt.Errorf("%w: %d", errDataOffsetTooLarge, offset)
}
Expand Down
Loading
Loading