Memory leak with dev_add_pack()

Spiro Trikaliotis ml-kernelnewbies at spiro.trikaliotis.net
Sun Jan 23 05:45:20 EST 2011


Hello Anish,

* On Sat, Jan 22, 2011 at 11:02:12PM +0530 anish kumar wrote:

>> I have been tasked with writing a kernel module to handle an own
>> protocol (with an own EtherType) in the Linux kernel.
>
> are you writing a kernel based sniffer??

Not really. I should take a custom protocol (with its own EtherType) and
tunnel it in a specific way to another machine.

In this sense: Yes, it is a sniffer.

However, as I wrote in my original mail, I used ETH_P_ALL instead of the
EtherType I need in order to make sure that I am leaking more memory, so
people can see it themselves faster.

>>   http://www.trikaliotis.net/testmodule/test_kernel.c
>
> which kernel version are you using and above code would not be sufficient 
> to find out the problem.Can
> you send the above file and makefile as well??

The problem occurrs with different kernel versions, as I wrote in my
other mail. It is a 2.6.26-2-686 from Debian Lenny, and a kernel
on Ubuntu 10.04, also 32 bit. Unfortunately this machine is currently
out of my reach, but I think it is a variant of 2.6.32 or 2.6.33.

The Makefile is already there, see the next part of my original message:

>>   the correspondig Makefile is in
>>   http://www.trikaliotis.net/testmodule/Makefile


>> While it essentially works as I want it to, I found that I am leaking
>
> if it is sniffer are you getting all the packets???

I would say yes. The fully functional version works as expected, if I
neglect the memory leak. Thus, I would expect I get all of the packets I
need.

Best regards,
Spiro.

-- 
Spiro R. Trikaliotis                              http://opencbm.sf.net/
http://www.trikaliotis.net/                     http://www.viceteam.org/



More information about the Kernelnewbies mailing list