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.
Questions tagged [netlink]
337 questions
52
votes
4 answers
How to use netlink socket to communicate with a kernel module?
I am trying to write a linux kernel module that communicates with user process using netlink. I am using netlink because the user program I want to communicate to communicates only using sockets and I can't change that to add ioctl() or anything.
I…

binW
- 13,220
- 11
- 56
- 69
24
votes
2 answers
what is the meaning of this macro _IOR(MY_MACIG, 0, int)?
i was going through ioctl sample programs to check how it communicates with kernel space. in program WRITE_IOCTL is used as command
#define WRITE_IOCTL _IOW(MY_MACIG, 1, int)
ioctl(fd, WRITE_IOCTL, "hello world")
I am not able to understand what…

Rafal
- 1,120
- 3
- 15
- 23
18
votes
1 answer
Unable to receive customized message sent from kernel module to user application using NETLINK_ROUTE channel
I am working with Netlink sockets to send customized notifications regarding the state of an ethernet interface from a kernel module to a user space application over the NETLINK_ROUTE channel. I have gone through several articles and papers but all…

iqstatic
- 2,322
- 3
- 21
- 39
14
votes
2 answers
Docker image fails to create netlink handle
Can anyone help me make sense of the below error and others like it? I've Googled around, but nothing makes sense for my context. I download my Docker Image, but the container refuses to start. The namespace referenced is not always 26, but could be…

Rome_Leader
- 2,518
- 9
- 42
- 73
12
votes
3 answers
RTNETLINK answers: No such file or directory
When I run this cmd:
tc qdisc add dev eth0 root red limit 51200000 min 128000 max 512000 avpkt 1024 burst 200 ecn probability 0.5
i get
RTNETLINK answers: No such file or directory
I have configured the kernel for netfilters, and all the…

vishal
- 121
- 1
- 1
- 3
12
votes
1 answer
iproute2 commands for MPLS configuration
Trying to figure out how one can use iproute2 to manage static label-switched MPLS routes in Linux kernel 4.1.
I am aware iproute2 support for MPLS might be incomplete right now [2].
Can anyone please shed some light on what iproute2-4.1.1 is…

user2798118
- 385
- 1
- 2
- 16
12
votes
3 answers
VLAN information using NETLINK
How do you get VLAN information like addition and deletion of VLAN sub interface from kernel to userspace using NETLINK socket in C?
I did little study in NETLINK man as suggested in comments. I added and deleted a VLAN sub interface and monitored…

user1762571
- 1,888
- 7
- 28
- 47
11
votes
1 answer
Is anyone using netlink for IPC?
I am planning to use netlink for communication between two userland processes. Part of the reason being so picky about netlink is - Most of the processing for one of the process would eventually go in kernel space and netlink based communication can…

gabhijit
- 3,345
- 2
- 23
- 36
11
votes
3 answers
netlink_kernel_create is not working with latest linux kernel
I am getting compiler error while compiling my old kernel module which is using netlink functions.
int
init_module()
{
/* Initialize the Netlink kernel interface */
nl_sk = netlink_kernel_create(&init_net, 17, 0, recv_cmd, NULL,…

Ibrar Ahmed
- 1,039
- 1
- 13
- 25
10
votes
3 answers
How to decode this information from strace output
I wrote a small go script and traced it using strace
though this script, I am trying to fetch audit messages from kernel using netlink protocol, just like like auditd.
Following is the strace output on my go script-…

Hardik Juneja
- 377
- 1
- 2
- 12
10
votes
1 answer
Two kernel modules, each uses netlink socket. How to use them both at the same time?
Good day. I would like to create two (almost same) modules - each module uses netlink socket and replies to the incoming message from userspace program.
During the initialization of the first module, it executes the following command…

Jake Badlands
- 1,016
- 3
- 23
- 46
9
votes
1 answer
Extract current route from netlink message, code attached
I'm trying to monitor route changes with netlink socket, but how should I get the updated route address ?
Code:
#include
#include
#include
#include
#include
#include…

daisy
- 22,498
- 29
- 129
- 265
8
votes
2 answers
Does anybody know equivalent for NETLINK Sockets API for MAC OS X?
Does anybody know equivalent for NETLINK Sockets API for MAC OS X ?
I am trying to port Linux application to MAC OS X and I couldn’t find anything similar in MACOS.
I need to provide asynchronous access to the network adapter in my…

Vlad
- 2,090
- 3
- 21
- 37
8
votes
2 answers
NetlinkEvent: NetlinkEvent::FindParam(): Parameter 'UID' not found
My application does not break during Runtime. However, the following error messages always show up
E/NetlinkEvent: NetlinkEvent::FindParam(): Parameter 'UID' not found
this log print continuously, i did not understand and what is cause of this…

Yogesh Rathi
- 6,331
- 4
- 51
- 81
8
votes
1 answer
What are the concepts of policies and attributes in generic netlink?
I am new in netlink programming. I am writing a generic netlink program for creating a netlink protocol family. I have searched many documents on the internet and I found something "Attributes and Policies" like things
for defining a netlink…

Nishant
- 267
- 3
- 11