]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: fix bpf compilation with old glibc
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Thu, 23 Jul 2015 07:17:41 +0000 (09:17 +0200)
committerStephen Hemminger <shemming@brocade.com>
Mon, 27 Jul 2015 21:35:42 +0000 (14:35 -0700)
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: 88eea5395483 ("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>
examples/bpf/bpf_agent.c
tc/f_bpf.c
tc/m_bpf.c

index 426b8800bf4e2f55381c1ed58939fccfeda90649..f9b9ce3ccb3dd11bd0ccc02db9209d5097cb05d4 100644 (file)
@@ -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);
index c21bf33fd25fe2977fd12b950f4d893f3b0e1ec9..490dc6b4e7ba58a8e56e7d5708316e5344e2fed6 100644 (file)
@@ -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();
 
index 9ddb6672693cb3a84fdf38fe2080bfed04cf5ffc..c51f44fc6ce6e38d6b8f3961e3fbfd2b6dd97b1c 100644 (file)
@@ -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();