diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2015-06-08 16:01:13 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2015-06-08 16:03:29 +0200 |
commit | b7ece46f62b1fbece160cc7bd2905a6d0d3970a9 (patch) | |
tree | 738419a37cd797b5ecbd930d43ff0d5440177c0f | |
parent | c00c007be4a00f299bde428068b4f93698256ee8 (diff) |
netsniff-ng: nlmsg: Fix build for older kernel headers
IFA_FLAGS and RTPROT_MROUTED might not be defined on older kernel
versions (as is evident from the Travis CI build failing [1]). Fix it by
conditionally using the two definitions.
[1] https://travis-ci.org/netsniff-ng/netsniff-ng/jobs/65887691
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r-- | proto_nlmsg.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/proto_nlmsg.c b/proto_nlmsg.c index 5a2527b..50a0d3f 100644 --- a/proto_nlmsg.c +++ b/proto_nlmsg.c @@ -472,6 +472,7 @@ static void rtnl_print_ifaddr(struct nlmsghdr *hdr) attr_fmt(attr, "Anycast %s", addr2str(ifa->ifa_family, RTA_DATA(attr), addr_str, sizeof(addr_str))); break; +#ifdef IFA_FLAGS case IFA_FLAGS: attr_fmt(attr, "Flags %d (%s%s%s)", RTA_INT(attr), colorize_start(bold), @@ -479,6 +480,7 @@ static void rtnl_print_ifaddr(struct nlmsghdr *hdr) flags, sizeof(flags)), colorize_end()); break; +#endif case IFA_LABEL: attr_fmt(attr, "Label %s", RTA_STR(attr)); break; @@ -534,7 +536,9 @@ static const char *route_proto2str(uint8_t proto) case RTPROT_XORP: return "xorp"; case RTPROT_NTK: return "netsukuku"; case RTPROT_DHCP: return "dhcpc"; +#ifdef RTPROT_MROUTED case RTPROT_MROUTED: return "mrouted"; +#endif default: return "Unknown"; } |