From bf0218c59b79b661ab2823952f7fd243b7b60315 Mon Sep 17 00:00:00 2001
From: Masahide NAKAMURA <nakam@linux-ipv6.org>
Date: Thu, 14 Dec 2006 21:40:33 +0900
Subject: [WORKAROUND][KERNELIF]: Fix kernel header check.

2.6.19 kernel doesn't have RTPROTO_MIP yet.
This is a workaround to skip to check it on kernel header and
hold it by src/util.h.
IFA_F_HOMEADDRESS is moved to linux/if_addr.h.
---
 config.h.in  |    4 ----
 configure.ac |    4 ++--
 src/util.h   |    8 ++++++++
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/config.h.in b/config.h.in
index b22d2b9..a0044dd 100644
--- a/config.h.in
+++ b/config.h.in
@@ -10,10 +10,6 @@
    you don't. */
 #undef HAVE_DECL_IFA_F_HOMEADDRESS
 
-/* Define to 1 if you have the declaration of `RTPROT_MIP', and to 0 if you
-   don't. */
-#undef HAVE_DECL_RTPROT_MIP
-
 /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
 #undef HAVE_DOPRNT
 
diff --git a/configure.ac b/configure.ac
index 07a2515..a9b1208 100644
--- a/configure.ac
+++ b/configure.ac
@@ -148,13 +148,13 @@ AM_CONDITIONAL(MISSING,
 	x$ac_cv_func_inet6_rth_gettype = xno)
 
 AC_MSG_NOTICE([*** checking for Mobile IPv6 support in kernel headers])
-AC_CHECK_DECLS([IFA_F_HOMEADDRESS,RTPROT_MIP],,
+AC_CHECK_DECLS([IFA_F_HOMEADDRESS],,
 	[AC_MSG_ERROR([kernel headers do not support MIPv6.
 
 *** If working Linux kernel headers are not in the default include path,
 *** please use CPPFLAGS variable to specify where they can be found 
 *** (e.g. CPPFLAGS="-isystem /usr/src/linux/include")
-])], [#include <linux/rtnetlink.h>])
+])], [#include <linux/if_addr.h>])
 
 AC_MSG_NOTICE([*** checking for Mobile IPv6 extensions in system headers])
 AC_CHECK_HEADERS([netinet/in.h netinet/ip6.h netinet/icmp6.h netinet/ip6mh.h])
diff --git a/src/util.h b/src/util.h
index f7c1b81..0dfbe72 100644
--- a/src/util.h
+++ b/src/util.h
@@ -209,4 +209,12 @@ static inline long max(long a, long b)
 	return (a > b) ? a : b;
 }
 
+/*
+ * XXX: These may be missing on kernel header because either kernel is not
+ * ready or should be removed since kernel will never support it.
+ */
+#ifndef RTPROT_MIP
+#define RTPROT_MIP	16
+#endif
+
 #endif /* __UTIL_H__ */
-- 
1.5.0.3

