Re: about netlink: skb_recv_datagram() function

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

 



On Wednesday 13 December 2006 22:03, Mauricio Lin wrote:
> Hi all,
>
> I am using a module that employs netlink functions and data.
>
> After compiling it, I insert the module as:
>
> # insmod test.ko
>
> but the terminal (prompt) gets locked. After debugging the module, I
> noticed that skb_recv_datagram() is responsible for that.
>
> Take a look the snippet of the code:
>
> skb = skb_recv_datagram(nl_sk, 0, 0, &err);
> if (!skb) {
> 	printk(KERN_ERR
> 	       "netlink_test: skb_recv_datagram!\n");
> 	return;
> }
>
> When I interrupt the prompt (as it was locked by inserting the module)
> typing <Control>+C, the message "netlink_test: skb_recv_datagram!" is
> printed, so I wonder why this is happening.
>
> Is it normal skb_recv_datagram() blocks the terminal? How can I solve
> it?
>

Hi Mauricio,

The skb_recv_datagram() will block until data is available to read. Since you 
call this function from module_init(), it will block the insmod process.

Regards,
tavi

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