summaryrefslogtreecommitdiffstats
path: root/libebtc.c
diff options
context:
space:
mode:
authorBart De Schuymer <bdschuym@pandora.be>2006-01-23 19:38:49 +0000
committerBart De Schuymer <bdschuym@pandora.be>2006-01-23 19:38:49 +0000
commit5976384bf7558f46b8cd2d341899394dcaded1e1 (patch)
treeb4d2cb89ef2623a521c3d2aab604562320e89222 /libebtc.c
parent1902d1843c5ef7c8f987a9bd7f743e22e052d84c (diff)
init hook_mask when no udc
Diffstat (limited to 'libebtc.c')
-rw-r--r--libebtc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libebtc.c b/libebtc.c
index a2801c7..4e429b6 100644
--- a/libebtc.c
+++ b/libebtc.c
@@ -990,7 +990,12 @@ void ebt_check_for_loops(struct ebt_u_replace *replace)
for (i = 0; i < replace->num_chains; i++) {
if (!(entries = replace->chains[i]))
continue;
- entries->hook_mask = 0;
+ if (i < NF_BR_NUMHOOKS)
+ /* (1 << NF_BR_NUMHOOKS) implies it's a standard chain
+ * (usefull in the final_check() funtions) */
+ entries->hook_mask = (1 << i) | (1 << NF_BR_NUMHOOKS);
+ else
+ entries->hook_mask = 0;
}
if (replace->num_chains == NF_BR_NUMHOOKS)
return;
@@ -1002,9 +1007,6 @@ void ebt_check_for_loops(struct ebt_u_replace *replace)
for (i = 0; i < NF_BR_NUMHOOKS; i++) {
if (!(entries = replace->chains[i]))
continue;
- /* (1 << NF_BR_NUMHOOKS) implies it's a standard chain
- * (usefull in the final_check() funtions) */
- entries->hook_mask = (1 << i) | (1 << NF_BR_NUMHOOKS);
chain_nr = i;
e = entries->entries->next;