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
2
votes
1 answer

Python Netlink Multicast Communication in Kernels above 4

I was trying to reproduce the example from a previous SO post on a kernel above 4 (4.1): #include #include #include #include #include /* Protocol family,…
user1252280
  • 373
  • 1
  • 7
  • 23
2
votes
2 answers

libnl getting error: Invalid Message

I'm trying to implement kernel-user communication using netlink sockets and the generic message type. So far I'm able to send Messages from user space to the kernel and then send a message back to user space. The Problem is that in my user space…
Thomas Sparber
  • 2,827
  • 2
  • 18
  • 34
2
votes
0 answers

Sending netfilter hook message to user space module via netlink socket success but loop

I am a beginner in Android kernel space programming. In my modules, kernel and user space module are successfully communicating via netlink sockets and netfilter hook also works. But when I send netfilter message to user space module via netlink…
Vergil
  • 21
  • 4
2
votes
1 answer

Add MPLS attributes in NETLINK Messages

Latest Linux Kernel 4.1.4 have MPLS data path support, We can program MPLS Routing table in kernel through NETLINK Socket. A new address family is defined AF_MPLS in socket.h. I tried some code to write - req.n.nlmsg_len =…
user2798118
  • 385
  • 1
  • 2
  • 16
2
votes
0 answers

How to disable netlinks from Linux kernel for link state change

I have any app A which is listening on netlink events for interface from kernel ( Link state change etc). I have another app B which does ifconfig up/ down. At this moment I don't want App A to get netlinks notified from kernel. How do I mask…
2
votes
1 answer

How can I get the pci address of a newly added NIC in C program without polling the kernel?

As per below link, i understood that by creating netlink socket and listen to the RTMGRP_LINK we can detect events(network interface create/delete/up/down events). How can I monitor the NIC status(up/down) in a C program without polling the…
user1762571
  • 1,888
  • 7
  • 28
  • 47
2
votes
2 answers

Netlink implementation for the Android NDK

I have a requirement for similar task as mentioned in this link.. Passive monitoring of sockets in Android. One way is parsing the /proc/net/{tcp,udp,...} tables. But we have to keep on reading continuously for keep on monitoring; which is not…
Suman
  • 4,221
  • 7
  • 44
  • 64
2
votes
1 answer

Incorrect len of msg in netlink socket

I tried to use netlink socket to send binary data from kernel space to user space. I followed the example from How to use netlink socket to communicate with a kernel module? However at the receiving end in userspace, I am getting received data…
Anup Warnulkar
  • 773
  • 1
  • 8
  • 25
2
votes
2 answers

C++ NetLink Sockets Error

I recently started again on a C++ application. I am using NetLink for Sockets and Visual Studio for developing. I made a small code but I got some errors. I've included the files from NetLink and I added ws2_32.lib (in linker/general & as pragma…
Joshua Bakker
  • 101
  • 1
  • 4
  • 10
2
votes
1 answer

What is the difference between NETLINK_FIREWALL and NETLINK_NETFILTER?

Both of the Netlink protocols NETLINK_FIREWALL (and NETLINK_IP6_FW) and NETLINK_NETFILTER are used to manupilate the Linux firewall. So, is there a diffrence? If yes, which Netlink protocol serves which purpose?
Marste
  • 627
  • 7
  • 22
2
votes
0 answers

get tcp_info with netlink for all connections?

Is it possible to get TCP_INFO struct with netlink for all tcp connections on linux? NETLINK_SOCK_DIAG seems doesn't contain that information If not netlink, what other options do I have?
est
  • 11,429
  • 14
  • 70
  • 118
2
votes
2 answers

Net Link Linux User code bind socket call always fail for multicast group Id (non zero value)

Hi am trying to implement net link user code and kernel code every thing works fine for unicast (src_addr.nl_groups = 0;). For mulicast, user code bind call always fails for non zero src_addr.nl_groups value. Really am not sure what value to put for…
rameshrgtvl
  • 243
  • 2
  • 16
2
votes
1 answer

Generic netlink - PID not thread unique

I'm writing kernel module that receives messages from userspace via generic netlink. When I access genl_info->snd_pid, in kernel callback function, I get process ID. According to libnl documentation: libnl generates unique port numbers based on the…
jimmy
  • 23
  • 4
2
votes
2 answers

I am not able to set MTU size of particular interfaces(eth0 or eth1) through Netlink sockets via NETLINK_ROUTE option

I have written a program to set the MTU size of the particular interface(say eth0 or eth1) to 1100. And the Request message is send from user space using Netlink sockets via NETLINK_ROUTE option. The message is sent successfully from user space,…
user1720713
  • 184
  • 8
2
votes
1 answer

Using GDB for debugging netlink communication

I have a multi-threaded application that communicates with a kernel module using netlink sockets. One of the threads in user mode application works as a server and kernel module works as a client. Roughly the kernel code is as follows: timeout =…
ghostkadost
  • 502
  • 4
  • 14