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.

312 questions
48
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 cant change that to add ioctl() or…
binW
  • 11,886
  • 9
  • 51
  • 67
18
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
  • 990
  • 3
  • 12
  • 22
16
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,176
  • 3
  • 17
  • 35
13
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,094
  • 9
  • 37
  • 63
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
  • 365
  • 1
  • 2
  • 16
12
votes
2 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,629
  • 4
  • 23
  • 41
11
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
  • 111
  • 1
  • 1
  • 3
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
  • 880
  • 1
  • 12
  • 24
10
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
  • 2,713
  • 1
  • 14
  • 31
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
  • 19,459
  • 24
  • 111
  • 218
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
  • 5,684
  • 4
  • 42
  • 71
8
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
  • 936
  • 3
  • 20
  • 44
8
votes
1 answer

Netlink Sockets in C using the 3.X linux kernel

Hi, I've been working on trying to get Netlink sockets to work for the 3.2 linux kernel, but I cannot seem to figure out how to do it. I have looked around for examples of the basics of Netlink sockets, but it seems all of the examples I find are…
Zac Reynolds
  • 113
  • 2
  • 6
7
votes
2 answers

How to get notified about network interface changes with Netlist and RTMGRP_LINK signal?

I write a program which needs to get notified if the network interfaces have changed, in particular new one appeared or existed one gone. My research brought to the netlink and its RTMGRP_LINK signal. This manpage gives an example which is not clear…
Ruslan Gerasimov
  • 1,626
  • 1
  • 12
  • 19
7
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
  • 317
  • 1
  • 2
  • 9
1
2 3
20 21