tc: fix bpf compilation with old glibc
Error was:
f_bpf.o: In function `bpf_parse_opt':
f_bpf.c:(.text+0x88f): undefined reference to `secure_getenv'
m_bpf.o: In function `parse_bpf':
m_bpf.c:(.text+0x587): undefined reference to `secure_getenv'
collect2: error: ld returned 1 exit status
There is no special reason to use the secure version of getenv, thus let's
simply use getenv().
CC: Daniel Borkmann <daniel@iogearbox.net>
Fixes: 88eea53954 ("tc: {f,m}_bpf: allow to retrieve uds path from env")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
This commit is contained in:
parent
814f9b9919
commit
611f70b287
|
|
@ -154,7 +154,7 @@ static void bpf_map_get_from_env(int *tfd)
|
||||||
memset(key, 0, sizeof(key));
|
memset(key, 0, sizeof(key));
|
||||||
snprintf(key, sizeof(key), "BPF_MAP%d", i);
|
snprintf(key, sizeof(key), "BPF_MAP%d", i);
|
||||||
|
|
||||||
val = secure_getenv(key);
|
val = getenv(key);
|
||||||
assert(val != NULL);
|
assert(val != NULL);
|
||||||
|
|
||||||
tfd[i] = atoi(val);
|
tfd[i] = atoi(val);
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ opt_bpf:
|
||||||
|
|
||||||
NEXT_ARG();
|
NEXT_ARG();
|
||||||
if (ebpf) {
|
if (ebpf) {
|
||||||
bpf_uds_name = secure_getenv(BPF_ENV_UDS);
|
bpf_uds_name = getenv(BPF_ENV_UDS);
|
||||||
bpf_obj = *argv;
|
bpf_obj = *argv;
|
||||||
NEXT_ARG();
|
NEXT_ARG();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ opt_bpf:
|
||||||
|
|
||||||
NEXT_ARG();
|
NEXT_ARG();
|
||||||
if (ebpf) {
|
if (ebpf) {
|
||||||
bpf_uds_name = secure_getenv(BPF_ENV_UDS);
|
bpf_uds_name = getenv(BPF_ENV_UDS);
|
||||||
bpf_obj = *argv;
|
bpf_obj = *argv;
|
||||||
NEXT_ARG();
|
NEXT_ARG();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue