summaryrefslogtreecommitdiff
path: root/ebtables.c
diff options
context:
space:
mode:
authorBart De Schuymer <bdschuym@pandora.be>2003-05-04 16:52:04 +0000
committerBart De Schuymer <bdschuym@pandora.be>2003-05-04 16:52:04 +0000
commit0cb0179bd91d131faa70c1b674ef7da861b69c59 (patch)
tree236c63c5de4d6a19fe84f7a0a776042688fca631 /ebtables.c
parent21aa50fff32d9730eea3c07bdbc321d758ee97a4 (diff)
downloadebtables-0cb0179bd91d131faa70c1b674ef7da861b69c59.tar.gz
ebtables-0cb0179bd91d131faa70c1b674ef7da861b69c59.tar.bz2
ebtables-0cb0179bd91d131faa70c1b674ef7da861b69c59.zip
--atomic-commit should only try insmod when all else fails
Diffstat (limited to 'ebtables.c')
-rw-r--r--ebtables.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/ebtables.c b/ebtables.c
index 29bccfe..27f2ff9 100644
--- a/ebtables.c
+++ b/ebtables.c
@@ -368,6 +368,7 @@ void register_table(struct ebt_u_table *t)
tables = t;
}
+const char *modprobe = NULL;
/*
* blatently stolen (again) from iptables.c userspace program
* find out where the modprobe utility is located
@@ -398,7 +399,7 @@ static char *get_modprobe(void)
return NULL;
}
-int ebtables_insmod(const char *modname, const char *modprobe)
+int ebtables_insmod(const char *modname)
{
char *buf = NULL;
char *argv[3];
@@ -1593,7 +1594,7 @@ void check_option(unsigned int *flags, unsigned int mask)
*flags |= mask;
}
-static void get_kernel_table(const char *modprobe)
+static void get_kernel_table()
{
if ( !(table = find_table(replace.name)) )
print_error("Bad table name");
@@ -1601,7 +1602,7 @@ static void get_kernel_table(const char *modprobe)
* get the kernel's information
*/
if (get_table(&replace)) {
- ebtables_insmod("ebtables", modprobe);
+ ebtables_insmod("ebtables");
if (get_table(&replace))
print_error("The kernel doesn't support the ebtables "
"%s table", replace.name);
@@ -1645,7 +1646,6 @@ int main(int argc, char *argv[])
struct ebt_u_match_list *m_l;
struct ebt_u_watcher_list *w_l;
struct ebt_u_entries *entries;
- const char *modprobe = NULL;
opterr = 0;
@@ -1691,7 +1691,7 @@ int main(int argc, char *argv[])
if (replace.flags & OPT_COMMAND)
print_error("Multiple commands not allowed");
replace.flags |= OPT_COMMAND;
- get_kernel_table(modprobe);
+ get_kernel_table();
if (optarg[0] == '-' || !strcmp(optarg, "!"))
print_error("No chain name specified");
if (c == 'N') {
@@ -1831,7 +1831,7 @@ int main(int argc, char *argv[])
" not allowed");
replace.flags |= OPT_COMMAND;
}
- get_kernel_table(modprobe);
+ get_kernel_table();
i = -1;
if (optarg) {
if ( (i = get_hooknr(optarg)) == -1 )
@@ -2161,7 +2161,6 @@ int main(int argc, char *argv[])
* possible memory leak here
*/
replace.filename = NULL;
- ebtables_insmod("ebtables", modprobe);
break;
case 7 : /* atomic-init */
case 10: /* atomic-save */
@@ -2178,7 +2177,7 @@ int main(int argc, char *argv[])
tmp = replace.filename;
/* get the kernel table */
replace.filename = NULL;
- get_kernel_table(modprobe);
+ get_kernel_table();
replace.filename = tmp;
}
if (replace.nentries) {