diff options
author | /C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org> | 2008-02-22 22:59:18 +0000 |
---|---|---|
committer | /C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org> | 2008-02-22 22:59:18 +0000 |
commit | ea5ae395bef0188a0f3d85444e9ae7abb611e051 (patch) | |
tree | a470a02a019a7f3f5a887e7e5a9726a280abf957 /src/deprecated.c | |
parent | 7f9112dc9b40a7cb952d2d5927cae12cbb35960a (diff) |
- fix broken 'deprecated backward compatibility'svn_t_libnetfilter_conntrack-0.0.89
- fix glibc 2.7.20 compilation (based on patch from Paul P. Konkoff)
Diffstat (limited to 'src/deprecated.c')
-rw-r--r-- | src/deprecated.c | 43 |
1 files changed, 17 insertions, 26 deletions
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; } |