summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/ip6tables.h4
-rw-r--r--include/iptables.h4
-rw-r--r--include/iptables_common.h1
-rw-r--r--ip6tables-restore.c6
-rw-r--r--ip6tables-save.c4
-rw-r--r--ip6tables-standalone.c4
-rw-r--r--ip6tables.c11
-rw-r--r--iptables-restore.c6
-rw-r--r--iptables-save.c4
-rw-r--r--iptables-standalone.c4
-rw-r--r--iptables.c11
11 files changed, 37 insertions, 22 deletions
diff --git a/include/ip6tables.h b/include/ip6tables.h
index 8360617..d4dadd8 100644
--- a/include/ip6tables.h
+++ b/include/ip6tables.h
@@ -4,6 +4,10 @@
#include "iptables_common.h"
#include "libiptc/libip6tc.h"
+#ifndef IP6T_LIB_DIR
+#define IP6T_LIB_DIR "/usr/local/lib/iptables"
+#endif
+
struct ip6tables_rule_match
{
struct ip6tables_rule_match *next;
diff --git a/include/iptables.h b/include/iptables.h
index 5aca69a..6d997f7 100644
--- a/include/iptables.h
+++ b/include/iptables.h
@@ -4,6 +4,10 @@
#include "iptables_common.h"
#include "libiptc/libiptc.h"
+#ifndef IPT_LIB_DIR
+#define IPT_LIB_DIR "/usr/local/lib/iptables"
+#endif
+
#ifndef IPPROTO_SCTP
#define IPPROTO_SCTP 132
#endif
diff --git a/include/iptables_common.h b/include/iptables_common.h
index ca65594..db5e93f 100644
--- a/include/iptables_common.h
+++ b/include/iptables_common.h
@@ -26,6 +26,7 @@ extern int iptables_insmod(const char *modname, const char *modprobe);
void exit_error(enum exittype, char *, ...)__attribute__((noreturn,
format(printf,2,3)));
extern const char *program_name, *program_version;
+extern char *lib_dir;
#ifdef NO_SHARED_LIBS
# ifdef _INIT
diff --git a/ip6tables-restore.c b/ip6tables-restore.c
index 76dddcb..6909c8d 100644
--- a/ip6tables-restore.c
+++ b/ip6tables-restore.c
@@ -7,7 +7,7 @@
* Rusty Russell <rusty@linuxcare.com.au>
* This code is distributed under the terms of GNU GPL v2
*
- * $Id: ip6tables-restore.c,v 1.22 2004/05/26 16:04:48 gandalf Exp $
+ * $Id$
*/
#include <getopt.h>
@@ -116,6 +116,10 @@ int main(int argc, char *argv[])
program_version = IPTABLES_VERSION;
line = 0;
+ lib_dir = getenv("IP6TABLES_LIB_DIR");
+ if (!lib_dir)
+ lib_dir = IP6T_LIB_DIR;
+
#ifdef NO_SHARED_LIBS
init_extensions();
#endif
diff --git a/ip6tables-save.c b/ip6tables-save.c
index 9deed33..37b1f19 100644
--- a/ip6tables-save.c
+++ b/ip6tables-save.c
@@ -322,6 +322,10 @@ int main(int argc, char *argv[])
program_name = "ip6tables-save";
program_version = IPTABLES_VERSION;
+ lib_dir = getenv("IP6TABLES_LIB_DIR");
+ if (!lib_dir)
+ lib_dir = IP6T_LIB_DIR;
+
#ifdef NO_SHARED_LIBS
init_extensions();
#endif
diff --git a/ip6tables-standalone.c b/ip6tables-standalone.c
index 7391ccf..36dde33 100644
--- a/ip6tables-standalone.c
+++ b/ip6tables-standalone.c
@@ -46,6 +46,10 @@ main(int argc, char *argv[])
program_name = "ip6tables";
program_version = IPTABLES_VERSION;
+ lib_dir = getenv("IP6TABLES_LIB_DIR");
+ if (!lib_dir)
+ lib_dir = IP6T_LIB_DIR;
+
#ifdef NO_SHARED_LIBS
init_extensions();
#endif
diff --git a/ip6tables.c b/ip6tables.c
index aac9531..aa1e148 100644
--- a/ip6tables.c
+++ b/ip6tables.c
@@ -50,10 +50,6 @@
#define FALSE 0
#endif
-#ifndef IP6T_LIB_DIR
-#define IP6T_LIB_DIR "/usr/local/lib/iptables"
-#endif
-
#ifndef PROC_SYS_MODPROBE
#define PROC_SYS_MODPROBE "/proc/sys/kernel/modprobe"
#endif
@@ -195,8 +191,7 @@ static int inverse_for_options[NUMBER_OF_OPT] =
const char *program_version;
const char *program_name;
-
-static char *lib_dir;
+char *lib_dir;
/* Keeping track of external matches and targets: linked lists. */
struct ip6tables_match *ip6tables_matches = NULL;
@@ -1718,10 +1713,6 @@ int do_command6(int argc, char *argv[], char **table, ip6tc_handle_t *handle)
memset(&fw, 0, sizeof(fw));
- lib_dir = getenv("IP6TABLES_LIB_DIR");
- if (!lib_dir)
- lib_dir = IP6T_LIB_DIR;
-
/* re-set optind to 0 in case do_command gets called
* a second time */
optind = 0;
diff --git a/iptables-restore.c b/iptables-restore.c
index 284f25c..42aa2a2 100644
--- a/iptables-restore.c
+++ b/iptables-restore.c
@@ -4,7 +4,7 @@
*
* This code is distributed under the terms of GNU GPL v2
*
- * $Id: iptables-restore.c,v 1.35 2004/06/25 11:18:57 kadlec Exp $
+ * $Id$
*/
#include <getopt.h>
@@ -119,6 +119,10 @@ main(int argc, char *argv[])
program_version = IPTABLES_VERSION;
line = 0;
+ lib_dir = getenv("IPTABLES_LIB_DIR");
+ if (!lib_dir)
+ lib_dir = IPT_LIB_DIR;
+
#ifdef NO_SHARED_LIBS
init_extensions();
#endif
diff --git a/iptables-save.c b/iptables-save.c
index d825130..6c7267e 100644
--- a/iptables-save.c
+++ b/iptables-save.c
@@ -335,6 +335,10 @@ main(int argc, char *argv[])
program_name = "iptables-save";
program_version = IPTABLES_VERSION;
+ lib_dir = getenv("IPTABLES_LIB_DIR");
+ if (!lib_dir)
+ lib_dir = IPT_LIB_DIR;
+
#ifdef NO_SHARED_LIBS
init_extensions();
#endif
diff --git a/iptables-standalone.c b/iptables-standalone.c
index 244db5f..257b677 100644
--- a/iptables-standalone.c
+++ b/iptables-standalone.c
@@ -52,6 +52,10 @@ main(int argc, char *argv[])
program_name = "iptables";
program_version = IPTABLES_VERSION;
+ lib_dir = getenv("IPTABLES_LIB_DIR");
+ if (!lib_dir)
+ lib_dir = IPT_LIB_DIR;
+
#ifdef NO_SHARED_LIBS
init_extensions();
#endif
diff --git a/iptables.c b/iptables.c
index 7c003ad..ca0a66f 100644
--- a/iptables.c
+++ b/iptables.c
@@ -47,10 +47,6 @@
#define FALSE 0
#endif
-#ifndef IPT_LIB_DIR
-#define IPT_LIB_DIR "/usr/local/lib/iptables"
-#endif
-
#ifndef PROC_SYS_MODPROBE
#define PROC_SYS_MODPROBE "/proc/sys/kernel/modprobe"
#endif
@@ -195,6 +191,7 @@ static int inverse_for_options[NUMBER_OF_OPT] =
const char *program_version;
const char *program_name;
+char *lib_dir;
/* Keeping track of external matches and targets: linked lists. */
struct iptables_match *iptables_matches = NULL;
@@ -210,8 +207,6 @@ struct pprot {
u_int8_t num;
};
-static char *lib_dir;
-
/* Primitive headers... */
/* defined in netinet/in.h */
#if 0
@@ -1715,10 +1710,6 @@ int do_command(int argc, char *argv[], char **table, iptc_handle_t *handle)
memset(&fw, 0, sizeof(fw));
- lib_dir = getenv("IPTABLES_LIB_DIR");
- if (!lib_dir)
- lib_dir = IPT_LIB_DIR;
-
/* re-set optind to 0 in case do_command gets called
* a second time */
optind = 0;