From 86424b1092214cac3bec97919c1236cb1e96853e Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Wed, 11 Feb 2004 22:03:12 +0000 Subject: get rid of warning when arptables is compiled in a 2.4 kernel, thanks to Siva Kumar Natarajan for the report --- userspace/arptables/arptables.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'userspace/arptables') diff --git a/userspace/arptables/arptables.c b/userspace/arptables/arptables.c index b10361f..b864900 100644 --- a/userspace/arptables/arptables.c +++ b/userspace/arptables/arptables.c @@ -1781,20 +1781,24 @@ int do_command(int argc, char *argv[], char **table, arptc_handle_t *handle) /* first figure out if this is a 2.6 or a 2.4 kernel */ *handle = arptc_init(*table); + /* 2.4 kernel: NF_ARP_NUMHOOKS = 2 */ if (!*handle) { - arptables_insmod("arp_tables", modprobe); + RUNTIME_NF_ARP_NUMHOOKS = 2; *handle = arptc_init(*table); if (!*handle) { - /* 2.4 kernel: NF_ARP_NUMHOOKS = 2 */ - RUNTIME_NF_ARP_NUMHOOKS = 2; + arptables_insmod("arp_tables", modprobe); + RUNTIME_NF_ARP_NUMHOOKS = 3; *handle = arptc_init(*table); if (!*handle) { - exit_error(VERSION_PROBLEM, - "can't initialize arptables table `%s': %s", - *table, arptc_strerror(errno)); + RUNTIME_NF_ARP_NUMHOOKS = 2; + *handle = arptc_init(*table); } } } + if (!*handle) + exit_error(VERSION_PROBLEM, + "can't initialize arptables table `%s': %s", + *table, arptc_strerror(errno)); memset(&fw, 0, sizeof(fw)); opts = original_opts; -- cgit v1.2.3