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
2 answers

Unable to use 'libnl' natively on Android. Unable to get nl80211 driver using `genl_ctrl_resolve()`

My goal is to use libnl in an Android Application to fetch a list of beacon frames received in the latest network scan and print (display) the associated metadata such as AP SSID, AP BSSID etc... Following basic tutorials and guidelines, the…
Gursimran Singh
  • 301
  • 2
  • 5
2
votes
0 answers

POLLERR with netlink sockets

I am using netlink sockets for user space to kernel space communication. In one of cases, recvmsg call fails with errno 105 which is ENOBUFS and then POLLERR is set on the fd. After this there cannot be any more data flow between the user space and…
lokesharo
  • 305
  • 2
  • 11
2
votes
2 answers

Linux IPv6 source address selection when interface has >1 IPv6 addresses: How to deprecate one?

In the context of IPv6 source address selection for outgoing traffic in Linux: I have some IPv6 address(es) on the interface. I want the kernel to pick one of those as the source IPv6 addr. I don't want the kernel to pick this address I'm about to…
2
votes
0 answers

How do I determine the name of the network interface I created with netlink?

I am using Netlink to create a network interface without specifying the name. Netlink chooses a name for the new interface (like for example "vlan0"), but I do not know how to figure this name out. My function calls are (in pseudo code): link =…
J. Doe
  • 146
  • 4
2
votes
0 answers

netlink interface listener in python

I have a code snippet which print interface information if any new interface is getting up, but it prints same interface information multiple times import os import socket import struct # These constants map to constants in the Linux kernel. This…
Arun
  • 1,149
  • 11
  • 22
2
votes
3 answers

Is there a way I can use netlink for Inter-process communication (IPC) between two user space processes?

I am a newbie to Linux. I have two User space processes, A and B, and B has to receive messages from A, do some processing, and ack when done. So I was looking at a two-way messaging protocol and was seeing netlink being used for communication…
HackX123
  • 107
  • 1
  • 9
2
votes
1 answer

Why max netlink msg size is limited to 16k

I am observing that max Netlink msg that my kernel module can send to user app is close to 16K. For larger sizes, genlmsg_unicast() succeeds but my app does not receive data. In my user app, I am using libnl I have tried increasing RECV buffer size…
user3857404
  • 113
  • 1
  • 8
2
votes
2 answers

How to get ipv4 address of an interface using libnl3 (netlink version 3) on linux?

I'm learning the netlink library version 3 and I want to know how to get the ipv4 address of a specified network interface. I can get the mac address and even requery the interface name from a link data structure, but I can not figure out how to…
netskink
  • 4,033
  • 2
  • 34
  • 46
2
votes
0 answers

How to implement a "ipvsadm --restore" like function using netlink for golang

I want implement a "ipvsadm --restore" like function, leveraging on github.com/vishvananda/netlink/nl. Search on github, I find a helpful golang ipvs lib in libnetwork. However, it just provide New/Update/Delete functions for Service and…
2
votes
2 answers

Adding an IPv6 address to the interface USING libmnl and rtnetlink

I am trying to add an IPv6 address to an ethernet interface, using libmnl. After constructing a message and sending to the kernel, I saw that it was not added to the interface, even though the return codes for the kernel reply did not contain any…
Khawar
  • 23
  • 4
2
votes
2 answers

Virtual machine and kernel communication using netlink

I wrote a linux kernel module and a user space application. They had been communicating very well via netlink. But I got errno 111 (connection refused) when I was trying to run the user space application on an emulated node in CORE (Common Open…
Tina
  • 41
  • 3
2
votes
1 answer

Can you subscribe to netlink events from the wpa_supplicant in linux?

Given the wpa_supplicant in Linux uses nl80211, can I subscribe to one of it's multicast groups and listen for association, di-association, authentication and de-authentication events?
Toshiro
  • 345
  • 2
  • 5
  • 14
2
votes
0 answers

Linux Kernel Netlink - Receive Callback Argument

Is there a way to have a callback argument passed to the netlink receive function when running in kernel space? I have the following code to create the socket: struct netlink_kernel_cfg net_cfg = { .input =…
trigger
  • 108
  • 7
2
votes
1 answer

sendmsg to Netlink fails with ECONNREFUSED if application is running in lxc container

The userspace application running on HOST works without any issue but the same application fails to run in LXC container with error ECONNREFUSED; The userspace application fails with ECONNREFUSED during sendmsg to netlink Linux kernel 3.4 with…
Viswesn
  • 4,674
  • 2
  • 28
  • 45
2
votes
2 answers

What multicast groups are available for each netlink family?

The netlink socket address structure is shown in the following struct sockaddr_nl { sa_family_t nl_family; /* AF_NETLINK */ unsigned short nl_pad; /* Zero. */ pid_t nl_pid; /* Port ID. */ __u32 …
Zajcev
  • 21
  • 2