Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reintroduce packed on keys #493

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 2 additions & 2 deletions bpf/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ typedef struct flow_id_t {
u8 icmp_code;
// OS interface index
u32 if_index;
} flow_id;
} __attribute__((packed)) flow_id;

// Force emitting enums/structs into the ELF
const struct flow_id_t *unused7 __attribute__((unused));
Expand Down Expand Up @@ -204,7 +204,7 @@ typedef struct dns_flow_id_t {
u8 dst_ip[IP_MAX_LEN];
u16 id;
u8 protocol;
} dns_flow_id;
} __attribute__((packed)) dns_flow_id;

// Enum to define global counters keys and share it with userspace
typedef enum global_counters_key_t {
Expand Down
4 changes: 1 addition & 3 deletions pkg/ebpf/bpf_arm64_bpfel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/ebpf/bpf_arm64_bpfel.o
Binary file not shown.
4 changes: 1 addition & 3 deletions pkg/ebpf/bpf_powerpc_bpfel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/ebpf/bpf_powerpc_bpfel.o
Binary file not shown.
4 changes: 1 addition & 3 deletions pkg/ebpf/bpf_s390_bpfeb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/ebpf/bpf_s390_bpfeb.o
Binary file not shown.
4 changes: 1 addition & 3 deletions pkg/ebpf/bpf_x86_bpfel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/ebpf/bpf_x86_bpfel.o
Binary file not shown.
9 changes: 4 additions & 5 deletions pkg/model/record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ func TestRecordBinaryEncoding(t *testing.T) {
0x03, // u8 direction
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x06, 0x07, 0x08, 0x09, // network: u8[16] src_ip
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x0b, 0x0c, 0x0d, // network: u8[16] dst_ip
0x00, // 1 byte padding
0x0e, 0x0f, // transport: u16 src_port
0x10, 0x11, // transport: u16 dst_port
0x12, // transport: u8 transport_protocol
0x00, // icmp: u8 icmp_type
0x00, // icmp: u8 icmp_code
0x00, 0x00, 0x00, // 3 bytes padding
0x12, // transport: u8 transport_protocol
0x00, // icmp: u8 icmp_type
0x00, // icmp: u8 icmp_code
0x13, 0x14, 0x15, 0x16, // interface index
0x00, 0x00, 0x00, 0x00, // 4 bytes padding
// Metrics
0x00, 0x00, 0x00, 0x00, // u32 lock
0x01, 0x02, // u16 eth_protocol
Expand Down
Loading