diff options
author | Rusty Russell <rusty@linuxcare.com.au> | 2000-06-02 20:12:24 +0000 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2000-06-02 20:12:24 +0000 |
commit | 5eed48af2516ebce0412121713d285bc30edb10d (patch) | |
tree | 55d6e37bc7c33bfb022af33eafd558f2bbbe69d2 /libiptc | |
parent | 4e242f822ef0add1359c540ed0cf3acdf74c63f3 (diff) |
Philip Blundell's IPv6 patches.
Diffstat (limited to 'libiptc')
-rw-r--r-- | libiptc/Makefile | 4 | ||||
-rw-r--r-- | libiptc/libip6tc.c | 21 |
2 files changed, 20 insertions, 5 deletions
diff --git a/libiptc/Makefile b/libiptc/Makefile index 7c0ff5e5..4df37958 100644 --- a/libiptc/Makefile +++ b/libiptc/Makefile @@ -9,8 +9,8 @@ local: else EXTRA_DEPENDS+=libiptc/libiptc.d -#libiptc/libiptc.a: libiptc/libiptc.a(libiptc/libip4tc.o libiptc/libip6tc.o) -libiptc/libiptc.a: libiptc/libiptc.a(libiptc/libip4tc.o) +libiptc/libiptc.a: libiptc/libiptc.a(libiptc/libip4tc.o libiptc/libip6tc.o) +#libiptc/libiptc.a: libiptc/libiptc.a(libiptc/libip4tc.o) libiptc/libiptc.d: %.d: %.c @-$(CC) -M -MG $(CFLAGS) $< | sed -e 's@^.*\.o:@$*.d $*.a($*.o):@' > $@ diff --git a/libiptc/libip6tc.c b/libiptc/libip6tc.c index dae85eb5..3bc596ae 100644 --- a/libiptc/libip6tc.c +++ b/libiptc/libip6tc.c @@ -265,6 +265,19 @@ is_same(const STRUCT_ENTRY *a, const STRUCT_ENTRY *b, return 1; } +/* All zeroes == unconditional rule. */ +static inline int +unconditional(const struct ip6t_ip6 *ipv6) +{ + unsigned int i; + + for (i = 0; i < sizeof(*ipv6); i++) + if (((char *)ipv6)[i]) + break; + + return (i == sizeof(*ipv6)); +} + #ifndef NDEBUG /* Do every conceivable sanity check on the handle */ static void @@ -342,7 +355,7 @@ do_check(TC_HANDLE_T h, unsigned int line) == get_chain_end(h, h->info.hook_entry[i])); e = get_entry(h, get_chain_end(h, h->info.hook_entry[i])); -// assert(unconditional(&e->ipv6)); + assert(unconditional(&e->ipv6)); assert(e->target_offset == sizeof(*e)); t = (STRUCT_STANDARD_TARGET *)GET_TARGET(e); assert(t->target.u.target_size == ALIGN(sizeof(*t))); @@ -369,9 +382,10 @@ do_check(TC_HANDLE_T h, unsigned int line) i = 0; n = 0; was_return = 0; +#if 0 /* Check all the entries. */ -// ENTRY_ITERATE(h->entries.entries, h->entries.size, -// check_entry, &i, &n, user_offset, &was_return, h); + ENTRY_ITERATE(h->entries.entries, h->entries.size, + check_entry, &i, &n, user_offset, &was_return, h); assert(i == h->new_number); assert(n == h->entries.size); @@ -380,5 +394,6 @@ do_check(TC_HANDLE_T h, unsigned int line) assert(strcmp(GET_TARGET(index2entry(h, h->new_number-1)) ->u.user.name, ERROR_TARGET) == 0); +#endif } #endif /*NDEBUG*/ |