Skip to content

Commit 53cd6c4

Browse files
authored
Merge pull request #98 from Sutter099/fix/union_init
syscall: fix bpf_map_op for gcc 15 union initialization semantics
2 parents e882e05 + 5e78db8 commit 53cd6c4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libply/aux/syscall.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ int bpf_prog_test_run(int prog_fd)
7070
static int bpf_map_op(enum bpf_cmd cmd, int fd,
7171
void *key, void *val_or_next, int flags)
7272
{
73-
union bpf_attr attr = {
74-
.map_fd = fd,
75-
.key = ptr_to_u64(key),
76-
.value = ptr_to_u64(val_or_next),
77-
.flags = flags,
78-
};
73+
union bpf_attr attr = {};
74+
75+
attr.map_fd = fd;
76+
attr.key = ptr_to_u64(key);
77+
attr.value = ptr_to_u64(val_or_next);
78+
attr.flags = flags;
7979

8080
return syscall(__NR_bpf, cmd, &attr, sizeof(attr));
8181
}

0 commit comments

Comments
 (0)