From: Nicolas Dichtel Date: Thu, 23 Jul 2015 07:17:41 +0000 (+0200) Subject: tc: fix bpf compilation with old glibc X-Git-Tag: v4.2.0~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=611f70b28719f09ca7bb998047915fa2aca52a2d;p=thirdparty%2Fiproute2.git 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 Fixes: 88eea5395483 ("tc: {f,m}_bpf: allow to retrieve uds path from env") Signed-off-by: Nicolas Dichtel Acked-by: Daniel Borkmann Acked-by: Alexei Starovoitov Tested-by: Yegor Yefremov --- diff --git a/examples/bpf/bpf_agent.c b/examples/bpf/bpf_agent.c index 426b8800b..f9b9ce3cc 100644 --- a/examples/bpf/bpf_agent.c +++ b/examples/bpf/bpf_agent.c @@ -154,7 +154,7 @@ static void bpf_map_get_from_env(int *tfd) memset(key, 0, sizeof(key)); snprintf(key, sizeof(key), "BPF_MAP%d", i); - val = secure_getenv(key); + val = getenv(key); assert(val != NULL); tfd[i] = atoi(val); diff --git a/tc/f_bpf.c b/tc/f_bpf.c index c21bf33fd..490dc6b4e 100644 --- a/tc/f_bpf.c +++ b/tc/f_bpf.c @@ -122,7 +122,7 @@ opt_bpf: NEXT_ARG(); if (ebpf) { - bpf_uds_name = secure_getenv(BPF_ENV_UDS); + bpf_uds_name = getenv(BPF_ENV_UDS); bpf_obj = *argv; NEXT_ARG(); diff --git a/tc/m_bpf.c b/tc/m_bpf.c index 9ddb66726..c51f44fc6 100644 --- a/tc/m_bpf.c +++ b/tc/m_bpf.c @@ -105,7 +105,7 @@ opt_bpf: NEXT_ARG(); if (ebpf) { - bpf_uds_name = secure_getenv(BPF_ENV_UDS); + bpf_uds_name = getenv(BPF_ENV_UDS); bpf_obj = *argv; NEXT_ARG();