dev_add_pack and sock_recvmsg use

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

 



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.

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?
it would be easier with netfilter hooks?

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,

topi


--
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