Questions tagged [netlink]

Netlink is a socket based inter process communication protocol for Linux systems. It is currently the preferred way, as of 2.6, of communicating with user space from the kernel.

337 questions
1
vote
1 answer

libusb-1.0 hotplug events stop working in parent after fork(), when child calls libusb_exit()

I've been developing an application that monitors the USB device tree using libusb_hotplug_register_callback(). When a device that matches some criteria is attached, it will fork() and exec() an application to handle this device. The application has…
Attie
  • 6,690
  • 2
  • 24
  • 34
1
vote
1 answer

msghdr behavior using Netlink to communicate between kernel space and user space

I'm currently working on a linux kernel module for a school project, that involves exposing the kernels hashtable implementation to user space. To achieve this, I've also created an user space API that communicates with the LKM via a Netlink…
Ludricio
  • 156
  • 16
1
vote
1 answer

netlink, link to libnl-3 and libnl-1

I have an application that uses libnl. It can use either versions (1 or 3), and during configure it tries first to use ibnl3 and fallback to libnl-1 if libnl3 was not found. My app uses another library that also uses libnl. The problem is that I…
rafi wiener
  • 587
  • 1
  • 9
  • 19
1
vote
0 answers

Is it possible to write a simple user-space code to monitor a uevent?

I am working on a simple project that (as I would like it to be) monitors a uevent for just one possible device and then receives data from it. I am using this on eLinux ported on a BeagleBone Black. Now, I know udev does exactly that albeit for…
1
vote
0 answers

netlink_register_notifier is not available with Network namespace support?

I could not find functions "netlink_register_notifier" or "netlink_unregister_notifier" which were used to handle notification during events like "NETLINK_URELEASE" in current Unix Kernel supporting network namespace that uses…
Viswesn
  • 4,674
  • 2
  • 28
  • 45
1
vote
2 answers

User space netlink socket receives empty messages from kernel space

Disclaimer - I have to admit that it's the 1'st time I'm using this kernel interface (socket). I'm currently working on a design of a kernel module that is based on a netlink socket . I'm using Ubuntu14.04 and linux kernel 4. As a starter, I wanted…
MotiC
  • 33
  • 1
  • 5
1
vote
4 answers

How to monitor ip address change using RTNETLINK socket in go language

I have following code, which should monitor network changes using RTNETLINK socket. However when I am setting new IP address for interface "New Addr" or "Del Addr" does not showing. What can be possible problem. package main import ( "fmt" …
Khamidulla
  • 2,927
  • 6
  • 35
  • 59
1
vote
1 answer

Why do I receive a Netlink ERRORMSG when using nl_recvmsgs?

I am trying to use nl_recvmsgs as a blocking function to receive Netlink messages from a kernel module. In my example the client sends a message to the kernel and then it calls nl_recvmsgs_report()(is equal to nl_recvmsgs). Then the kernel module…
aykes
  • 13
  • 4
1
vote
0 answers

How to skip Deleting route entry from Routing table during NetLink Socket Ip Deletion

I am using NetLink Socket To delete an IP from the interface. While Deleting the IP, It's deleting the Route Entry also from the Route table. But I want to keep that route entry in the routing table though I am deleting the IP from the Interface.
1
vote
0 answers

Linux Netfilter with Netlink crashed after running over 12 hours

I got a Linux Ubuntu crash report for running a kernel netfilter with user communication through netlink channel for around 12 hours. The netlink is used as an alert channel which will periodically (around 5 min) sent message from the kernel…
user1133555
  • 103
  • 8
1
vote
1 answer

recv() returning 0 in a netlink socket

In a networking socket between two host, recv() return value will be 0 when the peer in the other end has performed an orderly shutdown. what is the meaning of recv() returning 0 in a netlink socket(to communicate between userspace and kernel)…
user1762571
  • 1,888
  • 7
  • 28
  • 47
1
vote
1 answer

Error in netlink_kernel_create function

I just started learning Linux development and for the training purpose I wrote a simple loadable kernel module. When I try to add it by issuing the following command - make -C /lib/modules/$(uname -r)/build M=$PWD modules I get the following…
niko85
  • 303
  • 2
  • 12
1
vote
0 answers

FTN, ILM and NHLFE in kernel

Latest kernel 4.1 supports MPLS datapath. IpRoute2 is also adding commands to add mpls routes in kernel. What are the iproutes command to create FTN(Fec to NHLFE), ILM(Incoming Label Map) and NHLFE(Next hop label forwarding entry) ? What are the…
user2798118
  • 385
  • 1
  • 2
  • 16
1
vote
0 answers

Adding MPLS Routes in kernel 4.1.3

In Latest Kernel , there is a provision to add mpls routes in kernel, so that kernel can switch the traffic on basis of labels. I need to write a application from which I can program the MPLS Routes in kernel. However I don't know how can I do it, I…
user2798118
  • 385
  • 1
  • 2
  • 16
1
vote
1 answer

How to send and receive messages from function other than registered callback function in Netlink socket?

In following kernel module, I hooked syscall sys_open, and now trying to send filename to process in userspace using Netlink socket, in response process will return a msg, and then according to msg, the kernel module will proceed further. source…
Nitinkumar Ambekar
  • 969
  • 20
  • 39