From 7007975949f5177fbf2514633cc44ba0ac4712c5 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Tue, 27 Sep 2016 15:04:41 +0800 Subject: all: fix build on CentOS 6 by checking presence of several macros Protect usage of macros not present in pre-3.x kernels. Signed-off-by: Yousong Zhou Signed-off-by: Tobias Klauser --- proto_nlmsg.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'proto_nlmsg.c') diff --git a/proto_nlmsg.c b/proto_nlmsg.c index 6b43335..f8993e7 100644 --- a/proto_nlmsg.c +++ b/proto_nlmsg.c @@ -159,7 +159,9 @@ static const char *nlmsg_family2str(uint16_t family) case NETLINK_SCSITRANSPORT: return "SCSI transports"; case NETLINK_ECRYPTFS: return "ecryptfs"; case NETLINK_RDMA: return "RDMA"; +#if defined(NETLINK_CRYPTO) case NETLINK_CRYPTO: return "Crypto layer"; +#endif default: return "Unknown"; } } @@ -630,9 +632,11 @@ static void rtnl_print_route(struct nlmsghdr *hdr) rta_fmt(attr, "Pref Src %s", addr2str(rtm->rtm_family, RTA_DATA(attr), addr_str, sizeof(addr_str))); break; +#if defined(RTA_MARK) case RTA_MARK: rta_fmt(attr, "Mark 0x%x", RTA_UINT(attr)); break; +#endif case RTA_FLOW: rta_fmt(attr, "Flow 0x%x", RTA_UINT(attr)); break; -- cgit v1.2.3-54-g00ecf