Skip to content

Commit f67f118

Browse files
committed
fix offset again
1 parent cc660b3 commit f67f118

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

pkg/plugin/ebpfwindows/datapath_drop_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var dropNotifyLengthFromVersion = map[uint16]uint{
2929
DropNotifyVersion1: dropNotifyV1Len,
3030
}
3131

32-
var PktmonDropNotifyLengthFromVersion = map[uint16]uint{
32+
var pktmonDropNotifyLengthFromVersion = map[uint16]uint{
3333
DropNotifyVersion1: dropPktmonNotifyV1Len, // retain backwards compatibility for testing.
3434
}
3535

@@ -104,7 +104,7 @@ func DecodePktmonDrop(data []byte, pdn *PktmonDropNotify) error {
104104
// DataOffset returns the offset from the beginning of PktmonDropNotify where the
105105
// notification data begins.
106106
func (n *PktmonDropNotify) DataOffset() uint {
107-
return dropNotifyLengthFromVersion[n.VersionHeader.Version]
107+
return pktmonDropNotifyLengthFromVersion[n.VersionHeader.Version]
108108
}
109109

110110
func (n *PktmonDropNotify) decodePktmonDrop(data []byte) error {

test/e2e/tools/event-writer/bpf_event_writer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ void create_pktmon_drop_event(pktmon_notify_t* pktmon_drp_elm)
133133
{
134134
memset(pktmon_drp_elm, 0, sizeof(pktmon_notify_t));
135135
pktmon_drp_elm->version_header.type = PKTMON_NOTIFY_DROP;
136+
pktmon_drp_elm->version_header.version = 1;
136137
pktmon_drp_elm->pktmon_header.metadata.drop_reason = 7;
137138
}
138139

0 commit comments

Comments
 (0)