rtnl_link_get_kernel()

Wouter Verhelst w at uter.be
Wed Jul 4 01:32:15 EDT 2012


So I'm trying to use that (I don't need no steenking cache), but it's
not working.

My code does this:

(common.c)
static nl_sock* socket;

struct nl_sock* get_socket() {
	if(!socket) {
		socket = nl_socket_alloc();
		nl_socket_set_local_port(socket, 0);
	}
	return socket;
}

(actual code later on)

struct nl_sock* socket = get_socket();
struct rtnl_link* link = rtnl_link_alloc();

rtnl_link_get_kernel(socket, 0, "eth0", &link);

but that returns -NLE_BAD_SOCK. What am I missing?

-- 
The volume of a pizza of thickness a and radius z can be described by
the following formula:

pi zz a



More information about the libnl mailing list