kernel-netlink: Provide error information for Netlink sockets

#1467.
This commit is contained in:
Tobias Brunner
2016-06-10 10:34:09 +02:00
parent fc21465c66
commit a0178fe26e
3 changed files with 25 additions and 19 deletions
@@ -594,13 +594,15 @@ netlink_socket_t *netlink_socket_create(int protocol, enum_name_t *names,
}
if (this->socket == -1)
{
DBG1(DBG_KNL, "unable to create netlink socket");
DBG1(DBG_KNL, "unable to create netlink socket: %s (%d)",
strerror(errno), errno);
destroy(this);
return NULL;
}
if (bind(this->socket, (struct sockaddr*)&addr, sizeof(addr)))
{
DBG1(DBG_KNL, "unable to bind netlink socket");
DBG1(DBG_KNL, "unable to bind netlink socket: %s (%d)",
strerror(errno), errno);
destroy(this);
return NULL;
}