Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 08-04-2003, 12:54 PM   #1
LQ Newbie
Registered: Aug 2003
Posts: 3

Rep: Reputation: 0
Help installing custom netfilter module

I've been working on this for a few days straight, finally need to ask for help.

I'm running Slack 9 and I'm trying to add in a small netfilter module.

Here are the instructions to install it

header file for kernel module - place in /usr/src/linux/include/linux/netfilter_ipv4/

kernel module. place in /usr/src/linux/net/ipv4/netfilter
You must modify the Makefile and files in that directory to include,
and also modify /usr/src/linux/Documentation/ (I copied TOS's lines)
make menuconfig and then recompile at least your modules with mangle table
and TRIBES support. Make sure everything is enabled with lsmod
Well, I think I'm having trouble modifying the Makefile and files.

I added this line to the Makefile:
And this to the file:
Well, first of all I'm trying to recompile my entire Kernel after this. If I compile just the modules I'm unsure of what to do? I do a make dep; make modules; make modules_install - would I just copy the compiled files into my existing Linux install's netfilter dirs with all the other existing mods then do a modinst (or whatever the module install command is) on them? I borked something during the Kernel compile, and I wasn't able to boot to the new Kernel. But when I tried the modinst (?) command on the modules I got some Unresolved Symbol errors.

Since I'm just guessing at what I'm adding to the & makefile I think that is my problem.

This should allow me to read the server list for a game off of the 'master server' for the game and export it to a webpage w/ a combo of Apache, ANT and Tomcat. Someone else had this working but is no longer able to host it, that's why I'm working on this now.

Any help would be appreciated, I'm clueless with this Makefile &

Thank you!
Old 08-04-2003, 03:23 PM   #2
Registered: Mar 2003
Distribution: Debian
Posts: 275

Rep: Reputation: 30

You shouldn't need to install the .c and .h files into the linux src hierarchy. Just pull the CFLAGS from the Makefile, add a -DMODULE, and include the linux include directory. Something like this:

gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -DMODULE -I<wherever you src to the running kernel is>/include -o ipt_TRIBES.o ipt_TRIBES.c

Then 'cp ipt_TRIBES.o /lib/modules/`uname -r`/kernel/net/ipv4/netfilter/'
Notice the backtick on uname -r.

Run 'depmod -a' to rebuild the module dependencies

The module should have come with it's own makefile. Oh well. No need to rebuild the kernel either. (Unless there is patches, but you didn't mention any)

I haven't done this in a long time, but it should work.

Hope that helps,

PS What are the unresolved dependencies?
Old 08-04-2003, 04:16 PM   #3
LQ Newbie
Registered: Aug 2003
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for your quick reply. Still having some troubles though.

In fact, I'm not sure what's going on now. Here's the command I'm running:

root@linux:/home/tysoft/taa/LinuxNetFilter# gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -DMODULE -I /usr/src/linux/include -o ipt_TRIBES.o ipt_TRIBES.c
(the .o and .c files are obviously in the dir I'm running that from)

I get spit out a TON of errors from other .c & .h files that look like they're called by the TRIBES file

Bout 5 pages of things like /usr/src/linux/include/net/sock.h:1109: parse error before "u32" and "function declaration isn't a prototype" and "dereferencing pointer to incomplete type". More stuff like /usr/src/linux/include/linux/highmem.h:117: warning: passing arg 1 of 'kmap' for incompatible pointer type. The last error of them all is an "ipt_TRIBES.c:98: storage size of 'ipt_tribes_reg' isn't known.

Tried removing the -Wstrict-prototypes to no avail.

Obviously not getting a .o file output or anything (if I did wouldn't they end up in the dir I'm runnign the command from?).

The module doesn't have a makefile included, so I'm not sure how I could "Just pull the CFLAGS from the Makefile" unless you're referring to another Makefile.

I feel as if I'm completely off base here/missing something.

Thanks again for your reply, getting a few ideas and reading some other posts...
Old 08-04-2003, 04:41 PM   #4
LQ Newbie
Registered: Aug 2003
Posts: 3

Original Poster
Rep: Reputation: 0
I just did a make modules again (with everything in the src/linux directories) and tried to install the modules, now im getting a cannot find kernel that module was compiled for error, even though the usr/src/linux dir is the same version as im running. I think this is better than unresolved symbol errors... I see a lot of people have had similar problems with this error, trying a few things now


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
netfilter/iptables in kernel: module vs static -Nw- neX Linux - Security 5 03-25-2005 06:44 PM
Custom 2.6.10 kernel, how can I tell which NIC module I'm using? lowpro2k3 Slackware 2 01-10-2005 06:47 PM
fglrx compiling custom module problem (firegl_public.c) Slate01 Linux - Hardware 0 11-25-2004 02:25 PM
custom geforce video card--custom module? bandofmercy Linux - Hardware 3 10-14-2004 06:52 PM
Writting PAM Module for custom authentication? existo Linux - Networking 0 05-05-2004 05:07 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:26 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration