Hello,
I have written 2 modules that i want to be loaded each time kernel has been loaded. I add them in kernel directory of kernel source but i am getting following error
deny2.o(.text+0x50): In function `init_module':
: multiple definition of `init_module'
deny1.o(.text+0x190): first defined here
ld: Warning: size of symbol `init_module' changed from 110 to 57 in deny2.o
deny2.o(.text+0x90): In function `cleanup_module':
: multiple definition of `cleanup_module'
deny1.o(.text+0x200): first defined here
ld: Warning: size of symbol `cleanup_module' changed from 29 to 17 in deny2.o
make[2]: *** [kernel.o] Error 1
make[2]: Leaving directory `/usr/src/linux-2.4.24-module/kernel'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/usr/src/linux-2.4.24-module/kernel'
make: *** [_dir_kernel] Error 2
Both kernel modules have following similar calls code
static void __init init(void)
{
nfho.hook = hook_func;
nfho.hooknum = NF_IP_POST_ROUTING;
nfho.pf = PF_INET;
nfho.priority = NF_IP_PRI_FIRST;
nf_register_hook(&nfho);
}
static void __exit fini(void)
{
nf_unregister_hook(&nfho);
}
module_init(init);
module_exit(fini);
MODULE_LICENSE("GPL");
how to solve this error?
regards,
parag.