chiark / gitweb /
resolved: simplify detection of packets from the loopback device
[elogind.git] / src / shared / missing.h
index a88d9e414b171898f195134efdf5c48d9f08fbe2..bb4f8f23a8c2d7138de00e9067fa833b0a47b8b9 100644 (file)
@@ -527,3 +527,12 @@ static inline int setns(int fd, int nstype) {
 #ifndef BPF_XOR
 #  define BPF_XOR 0xa0
 #endif
+
+/* Note that LOOPBACK_IFINDEX is currently not exported by the
+ * kernel/glibc, but hardcoded internally by the kernel.  However, as
+ * it is exported to userspace indirectly via rtnetlink and the
+ * ioctls, and made use of widely we define it here too, in a way that
+ * is compatible with the kernel's internal definition. */
+#ifndef LOOPBACK_IFINDEX
+#define LOOPBACK_IFINDEX 1
+#endif