]> granicus.if.org Git - strace/commitdiff
netlink: provide a fallback definition of NETLINK_SOCK_DIAG
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 24 Jun 2017 22:25:28 +0000 (22:25 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 24 Jun 2017 22:25:28 +0000 (22:25 +0000)
Add a fallback definition of NETLINK_SOCK_DIAG to netlink.h
instead of adding these fallback definitions to every file.

* netlink.h: Provide a fallback definition of NETLINK_SOCK_DIAG.
* socketutils.c: Include "netlink.h" instead of <linux/netlink.h>,
remove fallback definition of NETLINK_SOCK_DIAG.

netlink.h
socketutils.c

index 63b1945cf8651e560c721cbd167b65d82ca6e527..5943229a55115acdda214c692009fa11a9ecf169 100644 (file)
--- a/netlink.h
+++ b/netlink.h
 #include <sys/socket.h>
 #include <linux/netlink.h>
 
+#ifndef NETLINK_SOCK_DIAG
+# define NETLINK_SOCK_DIAG 4
+#endif
+
 #undef NLMSG_HDRLEN
 #define NLMSG_HDRLEN ((unsigned int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
 
index 61d657897b28cfee523b533280687311373c657e..ce4e524913d50ea940289d668c19d5e6d8b1e304 100644 (file)
@@ -31,7 +31,7 @@
 #include <netinet/in.h>
 #include <sys/socket.h>
 #include <arpa/inet.h>
-#include <linux/netlink.h>
+#include "netlink.h"
 #include <linux/sock_diag.h>
 #include <linux/inet_diag.h>
 #include <linux/unix_diag.h>
 # define UNIX_PATH_MAX sizeof(((struct sockaddr_un *) 0)->sun_path)
 #endif
 
-#ifndef NETLINK_SOCK_DIAG
-# define NETLINK_SOCK_DIAG 4
-#endif
-
 typedef struct {
        unsigned long inode;
        char *details;