Fix build on systems that lack NETLINK_SOCK_DIAG definition

NETLINK_INET_DIAG was introduced in linux v2.6.14,
NETLINK_SOCK_DIAG was added much later in linux v3.3.

* net.c [!NETLINK_SOCK_DIAG && NETLINK_INET_DIAG]
(NETLINK_SOCK_DIAG): Define.
* socketutils.c: Likewise.
* tests/netlink_unix_diag.c: Likewise.
This commit is contained in:
2015-01-09 03:03:39 +00:00
parent 75d62047ad
commit d9f7e7a439
3 changed files with 12 additions and 1 deletions

View File

@@ -8,6 +8,10 @@
#include <linux/unix_diag.h>
#include <linux/rtnetlink.h>
#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG
# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG
#endif
#include <sys/un.h>
#ifndef UNIX_PATH_MAX
# define UNIX_PATH_MAX sizeof(((struct sockaddr_un *) 0)->sun_path)