Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-31-2010, 03:47 PM   #1
LQ Newbie
Registered: Aug 2010
Posts: 2

Rep: Reputation: 0
Question Netlink sockets in kernel and ethernet driver. Kernel crash.

Greetings to all.
I can not understand in what a problem.

I write the network driver. Transmission of packets in user space I do through netlink socket`s. In user space there is a handling of packets and their transmission on other device (however, it isn't important).

Problem in that any time, packets through the driver in system, and is reverse, are transferred normally. But then there comes the moment when the kernel crash. If to look in syslog it seems to me that comes deadlock. Also I think that it is related with netlink socket`s.

I can't find the information on that anywhere how correctly to use netlink socket`s in kernel space. Can at you will any a reason into the account of synchronization of sockets and the driver in kernel space?

I can give the driver code if it is necessary.

P.S. Sorry for my bad english
Old 09-06-2010, 02:53 PM   #2
LQ Newbie
Registered: Aug 2010
Posts: 2

Original Poster
Rep: Reputation: 0
I found the answer to question.

When i call netlink_kernel_create, in the first parameter i specified &init_net. Now i call register_pernet_device to create another struct net* copy. And now the kernel doesn't crash.
Old 05-08-2011, 12:57 PM   #3
LQ Newbie
Registered: May 2011
Posts: 1

Rep: Reputation: 0
driver code

dose it possible that you provide me ur source code i am trying to write network driver using socket in kernel
if you don't mind


driver, ethernet, netlink, socket, synchronization

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to install ethernet adapter driver, not finding kernel-devel or kernel-headers oneFishtwoFish Red Hat 5 08-31-2010 06:24 PM
Raw sockets for layer 2 ethernet on a 2.4 kernel rjcarlson49 Linux - Kernel 1 06-20-2010 12:14 AM
Help regarding Netlink sockets for 2.6 kernels: Kernel module priyankal Linux - Kernel 1 11-26-2009 04:49 AM
Netlink sockets usage to communicate b/w user and kernel space. vinodkr83 Linux - Newbie 1 07-03-2009 03:22 AM
Kernel module using netlink sockets arunka Programming 1 03-31-2005 07:42 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:13 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration