From ea5ae395bef0188a0f3d85444e9ae7abb611e051 Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org" Date: Fri, 22 Feb 2008 22:59:18 +0000 Subject: - fix broken 'deprecated backward compatibility' - fix glibc 2.7.20 compilation (based on patch from Paul P. Konkoff) --- src/deprecated.c | 43 +++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 26 deletions(-) (limited to 'src/deprecated.c') diff --git a/src/deprecated.c b/src/deprecated.c index 6555062..63a5699 100644 --- a/src/deprecated.c +++ b/src/deprecated.c @@ -43,6 +43,17 @@ static char *l3proto2str[AF_MAX] = { static struct nfct_proto *findproto(char *name); static struct nfct_l3proto *findl3proto(char *name); +void deprecated_backward_support() +{ + nfct_register_l3proto(&ipv4); + nfct_register_l3proto(&ipv6); + + nfct_register_proto(&tcp); + nfct_register_proto(&udp); + nfct_register_proto(&icmp); + nfct_register_proto(&sctp); +} + /* handler used for nfnl_listen */ static int callback_handler(struct sockaddr_nl *nladdr, struct nlmsghdr *n, void *arg) @@ -207,10 +218,6 @@ static struct nfct_proto *findproto(char *name) if (!name) return handler; - lib_dir = getenv("LIBNETFILTER_CONNTRACK_DIR"); - if (!lib_dir) - lib_dir = LIBNETFILTER_CONNTRACK_DIR; - list_for_each(i, &proto_list) { cur = (struct nfct_proto *) i; if (strcmp(cur->name, name) == 0) { @@ -219,15 +226,9 @@ static struct nfct_proto *findproto(char *name) } } - if (!handler) { - char path[sizeof("nfct_proto_.so") + strlen(VERSION) - + strlen(name) + strlen(lib_dir)]; - sprintf(path, "%s/nfct_proto_%s-%s.so", lib_dir, name, VERSION); - if (dlopen(path, RTLD_NOW)) - handler = findproto(name); - else - fprintf(stderr, "%s\n", dlerror()); - } + if (!handler) + fprintf(stderr, "libnetfilter_conntrack: " + "cannot find %s handler\n", name); return handler; } @@ -240,10 +241,6 @@ static struct nfct_l3proto *findl3proto(char *name) if (!name) return handler; - lib_dir = getenv("LIBNETFILTER_CONNTRACK_DIR"); - if (!lib_dir) - lib_dir = LIBNETFILTER_CONNTRACK_DIR; - list_for_each(i, &l3proto_list) { cur = (struct nfct_l3proto *) i; if (strcmp(cur->name, name) == 0) { @@ -252,15 +249,9 @@ static struct nfct_l3proto *findl3proto(char *name) } } - if (!handler) { - char path[sizeof("nfct_l3proto_.so") + strlen(VERSION) - + strlen(name) + strlen(lib_dir)]; - sprintf(path, "%s/nfct_l3proto_%s-%s.so",lib_dir,name,VERSION); - if (dlopen(path, RTLD_NOW)) - handler = findl3proto(name); - else - fprintf(stderr, "%s\n", dlerror()); - } + if (!handler) + fprintf(stderr, "libnetfilter_conntrack: " + "cannot find %s handler\n", name); return handler; } -- cgit v1.2.3