[radvd-devel-l] radvd for NetBSD/KAME-current
SUGYO Kazushi
radvd-devel-l@litech.org
Fri, 14 Jun 2002 14:14:57 +0900
Hello,
Here is a small patch for radvd-0.7.1.
sugyo
--- config.h.in.orig Thu Nov 15 05:01:49 2001
+++ config.h.in Fri Jun 14 13:34:33 2002
@@ -57,6 +57,9 @@
/* Define if you have the <net/if_types.h> header file. */
#undef HAVE_NET_IF_TYPES_H
+/* Define if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
/* Define if you have the <sys/sockio.h> header file. */
#undef HAVE_SYS_SOCKIO_H
--- configure.in.orig Thu Nov 15 04:58:11 2001
+++ configure.in Fri Jun 14 13:33:57 2002
@@ -156,6 +156,7 @@
AC_CHECK_HEADERS(sys/sockio.h getopt.h inttypes.h)
AC_CHECK_HEADERS(net/if_dl.h net/if_types.h net/if_arp.h)
+AC_CHECK_HEADERS(sys/param.h)
AC_CHECK_HEADERS(machine/param.h)
AC_CHECK_HEADERS(machine/limits.h)
--- includes.h.orig Tue Jan 15 23:51:42 2002
+++ includes.h Fri Jun 14 13:32:09 2002
@@ -36,12 +36,15 @@
# include <inttypes.h>
#endif
-#ifdef HAVE_MACHINE_PARAM_H
-# include <machine/param.h>
-#endif
-
-#ifdef HAVE_MACHINE_LIMITS_H
-# include <machine/limits.h>
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#else
+# ifdef HAVE_MACHINE_PARAM_H
+# include <machine/param.h>
+# endif
+# ifdef HAVE_MACHINE_LIMITS_H
+# include <machine/limits.h>
+# endif
#endif
#if TIME_WITH_SYS_TIME
--- socket.c.orig Thu Nov 15 04:58:11 2001
+++ socket.c Fri Jun 14 13:23:42 2002
@@ -33,12 +33,21 @@
}
val = 1;
+#ifdef IPV6_RECVPKTINFO
+ err = setsockopt(sock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &val, sizeof(int));
+ if (err < 0)
+ {
+ log(LOG_ERR, "setsockopt(IPV6_RECVPKTINFO): %s", strerror(errno));
+ return (-1);
+ }
+#else
err = setsockopt(sock, IPPROTO_IPV6, IPV6_PKTINFO, &val, sizeof(int));
if (err < 0)
{
log(LOG_ERR, "setsockopt(IPV6_PKTINFO): %s", strerror(errno));
return (-1);
}
+#endif /* IPV6_RECVPKTINFO */
val = 2;
#ifdef __linux__
@@ -68,6 +77,15 @@
return (-1);
}
+#ifdef IPV6_RECVHOPLIMIT
+ val = 1;
+ err = setsockopt(sock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &val, sizeof(int));
+ if (err < 0)
+ {
+ log(LOG_ERR, "setsockopt(IPV6_RECVHOPLIMIT): %s", strerror(errno));
+ return (-1);
+ }
+#else
#ifdef IPV6_HOPLIMIT
val = 1;
err = setsockopt(sock, IPPROTO_IPV6, IPV6_HOPLIMIT, &val, sizeof(int));
@@ -77,6 +95,7 @@
return (-1);
}
#endif
+#endif /* IPV6_RECVHOPLIMIT */
/*
* setup ICMP filter