Commit 53c01788 authored by Denys Fedoryshchenko's avatar Denys Fedoryshchenko Committed by Stephen Hemminger

iptables compatiablity

New iptables 1.4.0 has some library names changed from libipt to libxt.
It is prefferable also to open libxt_ first, as newer "style".
Signed-off-by: default avatarDenys Fedoryshchenko <nuclearcat@nuclearcat.com>
Signed-off-by: default avatarJamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: default avatarStephen Hemminger <stephen.hemminger@vyatta.com>
parent eeee367d
...@@ -68,6 +68,13 @@ register_target(struct iptables_target *me) ...@@ -68,6 +68,13 @@ register_target(struct iptables_target *me)
} }
void
xtables_register_target(struct iptables_target *me)
{
me->next = t_list;
t_list = me;
}
void void
exit_tryhelp(int status) exit_tryhelp(int status)
{ {
...@@ -248,11 +255,24 @@ get_target_name(const char *name) ...@@ -248,11 +255,24 @@ get_target_name(const char *name)
} }
} }
sprintf(path, "%s/libipt_%s.so",lib_dir, new_name); /* try libxt_xx first */
sprintf(path, "%s/libxt_%s.so", lib_dir, new_name);
handle = dlopen(path, RTLD_LAZY); handle = dlopen(path, RTLD_LAZY);
if (!handle) { if (!handle) {
sprintf(path, lib_dir, "/libipt_%s.so", lname); /* try libipt_xx next */
sprintf(path, "%s/libipt_%s.so", lib_dir, new_name);
handle = dlopen(path, RTLD_LAZY); handle = dlopen(path, RTLD_LAZY);
if (!handle) {
sprintf(path, "%s/libxt_%s.so", lib_dir , lname);
handle = dlopen(path, RTLD_LAZY);
}
if (!handle) {
sprintf(path, "%s/libipt_%s.so", lib_dir , lname);
handle = dlopen(path, RTLD_LAZY);
}
/* ok, lets give up .. */
if (!handle) { if (!handle) {
fputs(dlerror(), stderr); fputs(dlerror(), stderr);
printf("\n"); printf("\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment