From ba9d0b34c6a1eea958f85b54d341929d14f5e236 Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Fri, 4 Nov 2016 07:55:58 -0700 Subject: [PATCH] Fix build issue on FreeBSD 11 This fixes #174 temporarily, so at least it won't fail to build --- src/utils.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/utils.cpp b/src/utils.cpp index 37efda5..cd23685 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -244,7 +244,13 @@ vector route6_entries() { while (next < end) { rtm = (rt_msghdr*)next; // Filter protocol-cloned entries - if ((rtm->rtm_flags & RTF_WASCLONED) == 0 || (rtm->rtm_flags & RTF_PRCLONING) == 0) { + bool process_entry = true; + // These were removed in recent versions of FreeBSD + #if defined(RTF_WASCLONED) && defined(RTF_PRCLONING) + process_entry = (rtm->rtm_flags & RTF_WASCLONED) == 0 || + (rtm->rtm_flags & RTF_PRCLONING) == 0; + #endif + if (process_entry) { parse_header(rtm, sa); if (sa[RTAX_DST] && sa[RTAX_GATEWAY] && if_indextoname(rtm->rtm_index, iface_name)) { Route6Entry entry;