netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: shemminger@vyatta.com
Cc: netdev@vger.kernel.org,
	Nicolas Dichtel <nicolas.dichtel@6wind.com>,
	Daniel Borkmann <daniel@iogearbox.net>
Subject: [PATCH v2 iproute2] tc: fix bpf compilation with old glibc
Date: Thu, 23 Jul 2015 09:17:41 +0200	[thread overview]
Message-ID: <1437635861-19157-1-git-send-email-nicolas.dichtel@6wind.com> (raw)
In-Reply-To: <20150722094702.2eb3c0ea@urahara>

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>
---

v2: rework the fix to use getenv() instead of secure_getenv()

 examples/bpf/bpf_agent.c | 2 +-
 tc/f_bpf.c               | 2 +-
 tc/m_bpf.c               | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/examples/bpf/bpf_agent.c b/examples/bpf/bpf_agent.c
index 426b8800bf4e..f9b9ce3ccb3d 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 c21bf33fd25f..490dc6b4e7ba 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 9ddb6672693c..c51f44fc6ce6 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();
 
-- 
2.4.2

  reply	other threads:[~2015-07-23  7:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-22 12:29 [PATCH iproute2] tc: fix bpf compilation with old glibc Nicolas Dichtel
2015-07-22 13:05 ` Daniel Borkmann
2015-07-22 13:18   ` Nicolas Dichtel
     [not found] ` <19c76849dd1f4a94875b0aa5d3d7e96c@HQ1WP-EXMB12.corp.brocade.com>
2015-07-22 16:47   ` Stephen Hemminger
2015-07-23  7:17     ` Nicolas Dichtel [this message]
2015-07-23  7:25       ` [PATCH v2 " Daniel Borkmann
2015-07-23 21:50       ` Alexei Starovoitov
2015-07-27  8:09         ` Yegor Yefremov
2015-07-27 21:36 ` [PATCH " Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437635861-19157-1-git-send-email-nicolas.dichtel@6wind.com \
    --to=nicolas.dichtel@6wind.com \
    --cc=daniel@iogearbox.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).