summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <david@opensourcerouting.org>2016-07-27 20:02:54 +0200
committerDonald Sharp <sharpd@cumulusnetwroks.com>2016-07-27 14:20:51 -0400
commite62d0e2535b46e3eb6887b2276278c5c468b4731 (patch)
tree80525e165160a73def6ed9fa7d7e83e160b36ab2
parent355cf2a71abff73fc0ae9c53ac6200f330290c2b (diff)
pimd: supply VIFF_USE_IFINDEX definition
This fixes compilation if the system libc doesn't have VIFF_USE_IFINDEX. It'll still break runtime if the kernel is older than 2.6.32. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
-rw-r--r--pimd/pim_iface.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index 1dfbd9990a..14c8c7262e 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -41,6 +41,19 @@
#include "pim_time.h"
#include "pim_ssmpingd.h"
+#ifndef VIFF_USE_IFINDEX
+# ifdef linux
+/* make it work compile-time - whether it works runtime depends on the user
+ * having 2.6.32 or newer */
+# define VIFF_USE_IFINDEX 0x8
+# else
+# error no VIFF_USE_IFINDEX on this system, code needs porting
+/* NB: without VIFF_USE_IFINDEX, the local IP address is used to identify
+ * interfaces, which means it's impossible to support multiple interfaces that
+ * have the same or no IP address (e.g. unnumbered) */
+# endif
+#endif
+
struct interface *pim_regiface = NULL;
static void pim_if_igmp_join_del_all(struct interface *ifp);