Skip to contentSkip to conversation

tc: make symbols loaded from tc action modules global.

PATCH Applied Andreas Henriksson 2 participants 2 messages Aug 2, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tc: make symbols loaded from tc action modules global.

Fixes problems with xtables based MARK target ("ipt" module). When tc loads the "ipt" (xt) module it kept the symbols local, this made loading of libxtables not find the required struct.

currently ipt/xt is the only tc action module. iproute2 never seem to do dlclose.
hopefully the modules doesn't export more symbols then needed.

In this situation hopefully the RTLD_GLOBAL flag won't hurt us.

I've been using this patch in the Debian package of iproute for the last 3 weeks and noone has complained.
( This fixes http://bugs.debian.org/584898 )

---
 tc/m_action.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tc/m_action.c +1 -1
index a198158..6464b2e 100644
@@ -99,7 +99,7 @@ restart_s:
 	}
 
 	snprintf(buf, sizeof(buf), "%s/m_%s.so", get_tc_lib(), str);
-	dlh = dlopen(buf, RTLD_LAZY);
+	dlh = dlopen(buf, RTLD_LAZY | RTLD_GLOBAL);
 	if (dlh == NULL) {
 		dlh = aBODY;
 		if (dlh == NULL) {
Signature · 1 line
1.7.1
#1 lore raw
Quoted 24 lines · On Mon, 2 Aug 2010 09:30:33 +0200 Andreas Henriksson <[email protected]> wrote:

Fixes problems with xtables based MARK target ("ipt" module). When tc loads the "ipt" (xt) module it kept the symbols local, this made loading of libxtables not find the required struct.

currently ipt/xt is the only tc action module. iproute2 never seem to do dlclose.
hopefully the modules doesn't export more symbols then needed.

In this situation hopefully the RTLD_GLOBAL flag won't hurt us.

I've been using this patch in the Debian package of iproute for the last 3 weeks and noone has complained.
( This fixes http://bugs.debian.org/584898 )

---
 tc/m_action.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tc/m_action.c +0 -0
index a198158..6464b2e 100644

tc/m_action.c restart_s: · line 105

Quoted 8 lines
tc/m_action.c +1 -1
@@ -99,7 +99,7 @@ restart_s:
 	}
 
 	snprintf(buf, sizeof(buf), "%s/m_%s.so", get_tc_lib(), str);
-	dlh = dlopen(buf, RTLD_LAZY);
+	dlh = dlopen(buf, RTLD_LAZY | RTLD_GLOBAL);
 	if (dlh == NULL) {
 		dlh = aBODY;
 		if (dlh == NULL) {

Applied