summaryrefslogtreecommitdiff
path: root/proto_nlmsg.c
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2016-09-27 15:04:41 +0800
committerTobias Klauser <tklauser@distanz.ch>2016-09-29 09:29:08 +0200
commit7007975949f5177fbf2514633cc44ba0ac4712c5 (patch)
tree9a0e58e8d0c796ca83f4edfb18fd3a312f23f022 /proto_nlmsg.c
parent4749393697360d02b2612673473163214ff99be1 (diff)
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 <yszhou4tech@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'proto_nlmsg.c')
-rw-r--r--proto_nlmsg.c4
1 files changed, 4 insertions, 0 deletions
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;