Skip to content

Commit

Permalink
update: specify license directly in the probe instead of at load time
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Fontana <[email protected]>
  • Loading branch information
fntlnz authored and poiana committed Mar 24, 2021
1 parent d0b2ce8 commit 8918b95
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 0 additions & 2 deletions driver/bpf/filler_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ static __always_inline int bpf_addr_to_kernel(void *uaddr, int ulen,
{
if (ulen < 0 || ulen > sizeof(struct sockaddr_storage))
return -EINVAL;

if (ulen == 0)
return 0;

Expand Down Expand Up @@ -778,7 +777,6 @@ static __always_inline int __bpf_val_to_ring(struct filler_data *data,
}

sl = bpf_compute_snaplen(data, dpi_lookahead_size);

if (len > sl)
len = sl;
}
Expand Down
2 changes: 2 additions & 0 deletions driver/bpf/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,6 @@ int bpf_sched_process_fork(struct sched_process_fork_args *ctx)

char kernel_ver[] __bpf_section("kernel_version") = UTS_RELEASE;

char __license[] __bpf_section("license") = "GPL";

char probe_ver[] __bpf_section("probe_version") = PROBE_VERSION;
1 change: 0 additions & 1 deletion userspace/libscap/scap_bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ static int bpf_load_program(const struct bpf_insn *insns,
attr.prog_type = type;
attr.insn_cnt = (uint32_t) insns_cnt;
attr.insns = (unsigned long) insns;
attr.license = (unsigned long) "GPL";
attr.log_buf = (unsigned long) NULL;
attr.log_size = 0;
attr.log_level = 0;
Expand Down

0 comments on commit 8918b95

Please sign in to comment.