summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRusty Russell <rusty@linuxcare.com.au>2000-09-14 11:08:55 +0000
committerRusty Russell <rusty@rustcorp.com.au>2000-09-14 11:08:55 +0000
commitf92ba9bd4e68659e3c98aa0164cac87540ab3a76 (patch)
treeddde0c301a83d94d5790943e48b1e444e8835f58
parent10758b743d6aa076ebe2c3e8f855e73826841e71 (diff)
Add drop table support
-rw-r--r--libiptc/libip4tc.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libiptc/libip4tc.c b/libiptc/libip4tc.c
index 30cddb40..84b81d7c 100644
--- a/libiptc/libip4tc.c
+++ b/libiptc/libip4tc.c
@@ -382,7 +382,7 @@ do_check(TC_HANDLE_T h, unsigned int line)
== (1 << NF_IP_PRE_ROUTING
| 1 << NF_IP_LOCAL_OUT));
- /* Hooks should be first three */
+ /* Hooks should be first two */
assert(h->info.hook_entry[NF_IP_PRE_ROUTING] == 0);
n = get_chain_end(h, 0);
@@ -390,8 +390,18 @@ do_check(TC_HANDLE_T h, unsigned int line)
assert(h->info.hook_entry[NF_IP_LOCAL_OUT] == n);
user_offset = h->info.hook_entry[NF_IP_LOCAL_OUT];
- } else
+#ifdef NF_IP_DROPPING
+ } else if (strcmp(h->info.name, "drop") == 0) {
+ assert(h->info.valid_hooks == (1 << NF_IP_DROPPING));
+
+ /* Hook should be first */
+ assert(h->info.hook_entry[NF_IP_DROPPING] == 0);
+ user_offset = 0;
+#endif
+ } else {
+ fprintf(stderr, "Unknown table `s'\n", h->info.name);
abort();
+ }
/* User chain == end of last builtin + policy entry */
user_offset = get_chain_end(h, user_offset);