More on the Couldn't find standard target issue

Sander Smeenk <ssmeenk+ebtables-ntXksADE/[email protected]>
Newsgroups gmane.linux.network.bridge.ebtables.devel
Message-ID <[email protected]>
Hello,

I have checked the following with my image on my AccessPoint. 
By looking at the dmesg I see that Ebtables is active:

| Ebtables v2.0 registered<6>NET4: Ethernet Bridge 008 for NET4.0
| Bridge firewalling registered

Next I added some printf's in all find_* functions, like thisone:

| struct ebt_u_target *find_target(const char *name)
| {
|         struct ebt_u_target *t = targets;
| 
|         printf("find_target:REQ:trg: %s\n", name);
|         
|         while(t && strstr(t->name, name)) {
|                 printf("find_target:GOT:trg: %s\n", t->name);
|                 t = t->next;
|         }
|         return t;
| }

When I run this ebtables binary I see:

| $ ./ebtables -L
| find_target:REQ:trg: standard
| ebtables v2.0.2:ebtables.c:224:--BUG--:
| Couldn't load standard target

It tries to find 'standard' target, but the struct ebt_u_target *t seems
to contain no values since it doesn't even run through the loop once.

So, I checked where these targets should come from:

On line 144, the variable 'targets' is defined as a static struct of
type ebt_u_target, and is set to default value 'NULL'. 
The rest of the code does not touch the variable 'targets' so we reach main().

main() defines some other local variables and calls initialize_entry()
with a pointer to a struct 'ebt_u_entry'.

initialize_entry sets some default values in the struct it got from
main() and calls find_target(EBT_STANDARD_TARGET)

find_target() creates a new struct t, and defaults it to the value of
'targets' defined on line 144 (still NULL!) and tries to loop through
all elements as if it was an array.

I don't see where the struct 'targets' gets filled with possible
targetnames. But this would still be weird, because if it really didn't
get filled with targetnames, ebtables wouldn't work on any other system
either.

UNLESS there is something wrong with my kernelconfiguration. I have
ebtables /and/ it's modules /compiled in/ the kernel, not as a module,
so ebtables shouldn't and can't modprobe ebt_standard.o, since it is
already in the kernel. But then again, I don't see it try to modprobe
that module anywhere before the first call to find_target().

Am I looking over something?

Kind Regards,
Sander.
-- 
| Why is the third hand on the watch called a second hand?
| 1024D/08CEC94D - 34B3 3314 B146 E13C 70C8  9BDB D463 7E41 08CE C94D


-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.