Re: dev_add_pack and sock_recvmsg use

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
 for your second question refer http://uqconnect.net/~zzoklan/documents/netfilter.html and check listing4 example that shows how to drop packets.
regards,
Parag.

On 12/14/05, Parag N(पराग़) <panemade@xxxxxxxxx> wrote:
Hello,

On 12/14/05, toni < agar9938@xxxxxxxxxxxxxxxxxx> wrote:
hello,

i'm programming a monitoring application for udp (as voice streams, over
RTP). the scope of the application is to act as a filter between MAC and
IP layers to acquire data (packet bytes and src/dst addresses/ports) and
optionally drop some streams.
  yes you can do that easily with netfilter hooks.

 
dispite it could be done in user-space, i'm doing it in a kernel module
and i'm having some problems...

1) to get all ethernet frames i'm using dev_add_pack:

   static struct packet_type kvoipmonitor_packet_type = {
        .type = __constant_htons(ETH_P_ALL),
        .func = (void *)kvoipmonitor_rcv,
   };
   dev_add_pack(&kvoipmonitor_packet_type);

but i can't get packets promiscuosly, isn't? i only receive PACKET_HOST,
PACKET_BROADCAST and PACKET_OUTGOING packets (and not PACKET_OTHERHOST)

it's correct what i'm doing?
   i dont think thT you require to add new packet handler.      

it would be easier with netfilter hooks?

      yes.
2) the same kernel module starts a kernel thread to listen on a udp
socket. it works fine, but i can't kill the kernel thread because when
unloading the module it's blocked in the sock_recvmsg function

how must be invoked the sock_recvmsg function to allow to be interrupted
by a SIGKILL signal?


thanks in advance,

toni


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux