/* Fix for unresolvable symbols leading to errors such as : * Unknown qdisc "tbf", hence option "help" is unparsable */ diff -ur iproute2-2.6.35/ip/Makefile iproute2-2.6.35-fix/ip/Makefile --- iproute2-2.6.35/ip/Makefile 2011-01-14 12:50:39 +0100 +++ iproute2-2.6.35-fix/ip/Makefile 2011-01-14 12:51:06 +0100 @@ -30,14 +30,13 @@ LDLIBS += -ldl LDFLAGS += -Wl,-export-dynamic -else +endif ip: static-syms.o static-syms.o: static-syms.h static-syms.h: $(wildcard *.c) files="$^" ; \ - for s in `grep -B 3 '\ $@ -endif diff -ur iproute2-2.6.35/ip/ip_common.h iproute2-2.6.35-fix/ip/ip_common.h --- iproute2-2.6.35/ip/ip_common.h 2010-08-04 19:45:59 +0200 +++ iproute2-2.6.35-fix/ip/ip_common.h 2011-01-14 12:52:23 +0100 @@ -64,6 +64,7 @@ }; struct link_util *get_link_kind(const char *kind); +extern void *resolve_sym(void *handle, const char *sym); #ifndef INFINITY_LIFE_TIME #define INFINITY_LIFE_TIME 0xFFFFFFFFU diff -ur iproute2-2.6.35/ip/iplink.c iproute2-2.6.35-fix/ip/iplink.c --- iproute2-2.6.35/ip/iplink.c 2011-01-14 12:50:33 +0100 +++ iproute2-2.6.35-fix/ip/iplink.c 2011-01-14 12:51:18 +0100 @@ -117,7 +117,7 @@ } snprintf(buf, sizeof(buf), "%s_link_util", id); - l = dlsym(dlh, buf); + l = resolve_sym(dlh, buf); if (l == NULL) return NULL; diff -ur iproute2-2.6.35/ip/static-syms.c iproute2-2.6.35-fix/ip/static-syms.c --- iproute2-2.6.35/ip/static-syms.c 2010-08-04 19:45:59 +0200 +++ iproute2-2.6.35-fix/ip/static-syms.c 2011-01-14 12:51:35 +0100 @@ -1,6 +1,7 @@ #include -void *_dlsym(const char *sym) +#include +void *resolve_sym(void *handle, const char *sym) { #include "static-syms.h" - return NULL; + return dlsym(handle, sym); } diff -ur iproute2-2.6.35/tc/Makefile iproute2-2.6.35-fix/tc/Makefile --- iproute2-2.6.35/tc/Makefile 2010-08-04 19:45:59 +0200 +++ iproute2-2.6.35-fix/tc/Makefile 2011-01-14 12:48:21 +0100 @@ -131,14 +131,11 @@ %.lex.c: %.l $(LEX) $(LEXFLAGS) -o$@ $< -ifneq ($(SHARED_LIBS),y) - tc: static-syms.o static-syms.o: static-syms.h static-syms.h: $(wildcard *.c) files="$^" ; \ - for s in `grep -B 3 '\ $@ -endif diff -ur iproute2-2.6.35/tc/m_action.c iproute2-2.6.35-fix/tc/m_action.c --- iproute2-2.6.35/tc/m_action.c 2010-08-04 19:45:59 +0200 +++ iproute2-2.6.35-fix/tc/m_action.c 2011-01-14 12:43:13 +0100 @@ -110,7 +110,7 @@ } snprintf(buf, sizeof(buf), "%s_action_util", str); - a = dlsym(dlh, buf); + a = resolve_sym(dlh, buf); if (a == NULL) goto noexist; diff -ur iproute2-2.6.35/tc/m_ematch.c iproute2-2.6.35-fix/tc/m_ematch.c --- iproute2-2.6.35/tc/m_ematch.c 2010-08-04 19:45:59 +0200 +++ iproute2-2.6.35-fix/tc/m_ematch.c 2011-01-14 12:43:21 +0100 @@ -150,7 +150,7 @@ } snprintf(buf, sizeof(buf), "%s_ematch_util", kind); - e = dlsym(dlh, buf); + e = resolve_sym(dlh, buf); if (e == NULL) return NULL; diff -ur iproute2-2.6.35/tc/m_ipt.c iproute2-2.6.35-fix/tc/m_ipt.c --- iproute2-2.6.35/tc/m_ipt.c 2010-08-04 19:45:59 +0200 +++ iproute2-2.6.35-fix/tc/m_ipt.c 2011-01-14 12:43:29 +0100 @@ -285,9 +285,9 @@ } } - m = dlsym(handle, new_name); + m = resolve_sym(handle, new_name); if ((error = dlerror()) != NULL) { - m = (struct iptables_target *) dlsym(handle, lname); + m = (struct iptables_target *) resolve_sym(handle, lname); if ((error = dlerror()) != NULL) { m = find_t(new_name); if (NULL == m) { diff -ur iproute2-2.6.35/tc/m_pedit.c iproute2-2.6.35-fix/tc/m_pedit.c --- iproute2-2.6.35/tc/m_pedit.c 2010-08-04 19:45:59 +0200 +++ iproute2-2.6.35-fix/tc/m_pedit.c 2011-01-14 12:43:38 +0100 @@ -98,7 +98,7 @@ } snprintf(buf, sizeof(buf), "p_pedit_%s", str); - p = dlsym(dlh, buf); + p = resolve_sym(dlh, buf); if (p == NULL) goto noexist; diff -ur iproute2-2.6.35/tc/static-syms.c iproute2-2.6.35-fix/tc/static-syms.c --- iproute2-2.6.35/tc/static-syms.c 2010-08-04 19:45:59 +0200 +++ iproute2-2.6.35-fix/tc/static-syms.c 2011-01-14 12:42:16 +0100 @@ -1,6 +1,7 @@ #include -void *_dlsym(const char *sym) +#include +void *resolve_sym(void *handle, const char *sym) { #include "static-syms.h" - return NULL; + return dlsym(handle, sym); } diff -ur iproute2-2.6.35/tc/tc.c iproute2-2.6.35-fix/tc/tc.c --- iproute2-2.6.35/tc/tc.c 2010-08-04 19:45:59 +0200 +++ iproute2-2.6.35-fix/tc/tc.c 2011-01-14 12:42:48 +0100 @@ -114,7 +114,7 @@ } snprintf(buf, sizeof(buf), "%s_qdisc_util", str); - q = dlsym(dlh, buf); + q = resolve_sym(dlh, buf); if (q == NULL) goto noexist; @@ -159,7 +159,7 @@ } snprintf(buf, sizeof(buf), "%s_filter_util", str); - q = dlsym(dlh, buf); + q = resolve_sym(dlh, buf); if (q == NULL) goto noexist; diff -ur iproute2-2.6.35/tc/tc_common.h iproute2-2.6.35-fix/tc/tc_common.h --- iproute2-2.6.35/tc/tc_common.h 2010-08-04 19:45:59 +0200 +++ iproute2-2.6.35-fix/tc/tc_common.h 2011-01-14 12:52:17 +0100 @@ -19,3 +19,4 @@ struct tc_sizespec; extern int parse_size_table(int *p_argc, char ***p_argv, struct tc_sizespec *s); extern int check_size_table_opts(struct tc_sizespec *s); +extern void *resolve_sym(void *handle, const char *sym);