From: Dmitry V. Levin Date: Sat, 24 Jun 2017 22:25:28 +0000 (+0000) Subject: netlink: provide a fallback definition of NETLINK_SOCK_DIAG X-Git-Tag: v4.18~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fd68eabd59b714861be37d8809cf79016fcb81a0;p=strace netlink: provide a fallback definition of NETLINK_SOCK_DIAG 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 , remove fallback definition of NETLINK_SOCK_DIAG. --- diff --git a/netlink.h b/netlink.h index 63b1945c..5943229a 100644 --- a/netlink.h +++ b/netlink.h @@ -32,6 +32,10 @@ #include #include +#ifndef NETLINK_SOCK_DIAG +# define NETLINK_SOCK_DIAG 4 +#endif + #undef NLMSG_HDRLEN #define NLMSG_HDRLEN ((unsigned int) NLMSG_ALIGN(sizeof(struct nlmsghdr))) diff --git a/socketutils.c b/socketutils.c index 61d65789..ce4e5249 100644 --- a/socketutils.c +++ b/socketutils.c @@ -31,7 +31,7 @@ #include #include #include -#include +#include "netlink.h" #include #include #include @@ -46,10 +46,6 @@ # 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;