aboutsummaryrefslogtreecommitdiff
path: root/net/miredo
diff options
context:
space:
mode:
authorMunechika SUMIKAWA <sumikawa@FreeBSD.org>2009-06-30 07:07:47 +0000
committerMunechika SUMIKAWA <sumikawa@FreeBSD.org>2009-06-30 07:07:47 +0000
commit31bf30a12605ab0dd297f15810b15ddb48b9b4f7 (patch)
tree114882d96f2ea4725ba94c5f5098286a1f111eb2 /net/miredo
parent81c02f1b6c3cff8d156019f61b5edd2e9254ad11 (diff)
downloadports-31bf30a12605ab0dd297f15810b15ddb48b9b4f7.tar.gz
ports-31bf30a12605ab0dd297f15810b15ddb48b9b4f7.zip
Notes
Diffstat (limited to 'net/miredo')
-rw-r--r--net/miredo/Makefile5
-rw-r--r--net/miredo/files/patch-libtun6-tun6.c78
-rw-r--r--net/miredo/files/patch-misc-client-hook.bsd28
-rw-r--r--net/miredo/files/patch-src-relayd.c18
4 files changed, 126 insertions, 3 deletions
diff --git a/net/miredo/Makefile b/net/miredo/Makefile
index 17bb4434a224..9d16a04abe8b 100644
--- a/net/miredo/Makefile
+++ b/net/miredo/Makefile
@@ -7,6 +7,7 @@
PORTNAME= miredo
PORTVERSION= 1.1.6
+PORTREVISION= 1
CATEGORIES= net ipv6
MASTER_SITES= http://www.remlab.net/files/miredo/archive/
@@ -25,9 +26,7 @@ MAN5= miredo-server.conf.5 miredo.conf.5
MAN8= miredo-server.8 miredo.8 miredo-checkconf.8
USE_RC_SUBR= miredo_server miredo
-CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include" \
- CFLAGS="${PTHREAD_CFLAGS}" \
- LDFLAGS="-L${LOCALBASE}/lib ${PTHREAD_LIBS}"
+CONFIGURE_ENV+= LDFLAGS="-L${LOCALBASE}/lib"
.if !defined(WITHOUT_NLS)
USE_GETTEXT= yes
diff --git a/net/miredo/files/patch-libtun6-tun6.c b/net/miredo/files/patch-libtun6-tun6.c
new file mode 100644
index 000000000000..ba75c06f983a
--- /dev/null
+++ b/net/miredo/files/patch-libtun6-tun6.c
@@ -0,0 +1,78 @@
+diff --git libtun6/tun6.c libtun6/tun6.c
+index c0e37ba..a9a3c4c 100644
+--- libtun6/tun6.c
++++ libtun6/tun6.c
+@@ -81,6 +81,7 @@ typedef struct
+ defined (__OpenBSD__) || defined (__OpenBSD_kernel__) || \
+ defined (__DragonFly__) || \
+ defined (__APPLE__) /* Darwin */
++#include <ifaddrs.h>
+ /*
+ * BSD tunneling driver
+ * NOTE: the driver is NOT tested on Darwin (Mac OS X).
+@@ -492,8 +493,7 @@ plen_to_sin6 (unsigned plen, struct sockaddr_in6 *sin6)
+ {
+ memset (sin6, 0, sizeof (struct sockaddr_in6));
+
+- /* NetBSD kernel strangeness:
+- sin6->sin6_family = AF_INET6;*/
++ sin6->sin6_family = AF_INET6;
+ # ifdef HAVE_SA_LEN
+ sin6->sin6_len = sizeof (struct sockaddr_in6);
+ # endif
+@@ -636,8 +636,8 @@ _iface_route (int reqfd, int id, bool add, const struct in6_addr *addr,
+ {
+ struct rt_msghdr hdr;
+ struct sockaddr_in6 dst;
+- struct sockaddr_dl gw;
+- struct sockaddr_in6 mask;
++ struct sockaddr_storage gw;
++ struct sockaddr_storage dummy; /* allocate space for netmask */
+ } msg;
+
+ shutdown (s, 0);
+@@ -661,11 +661,31 @@ _iface_route (int reqfd, int id, bool add, const struct in6_addr *addr,
+ msg.dst.sin6_len = sizeof (msg.dst);
+ memcpy (&msg.dst.sin6_addr, addr, sizeof (msg.dst.sin6_addr));
+
+- msg.gw.sdl_family = AF_LINK;
+- msg.gw.sdl_len = sizeof (msg.gw);
+- msg.gw.sdl_index = id;
++ struct ifaddrs *ifap, *ifa;
++ struct sockaddr_dl *sdl = NULL;
+
+- plen_to_sin6 (prefix_len, &msg.mask);
++ if (getifaddrs(&ifap)) {
++ syslog (LOG_ERR, "getifaddrs erorr\n");
++ return -1;
++ }
++ for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
++ if (ifa->ifa_addr == NULL)
++ continue;
++ if (ifa->ifa_addr->sa_family != AF_LINK)
++ continue;
++ if (id == ((struct sockaddr_dl *)ifa->ifa_addr)->sdl_index)
++ sdl = (struct sockaddr_dl *)ifa->ifa_addr;
++ }
++ if (sdl == NULL) {
++ syslog (LOG_ERR, "no sdl found\n");
++ freeifaddrs(ifap);
++ return -1;
++ }
++ memcpy(&msg.gw, sdl, sdl->sdl_len);
++ freeifaddrs(ifap);
++
++ struct sockaddr_in6 *mask = (struct sockaddr_in6 *)((u_char *)&msg.gw + sdl->sdl_len);
++ plen_to_sin6 (prefix_len, mask);
+
+ errno = 0;
+
+@@ -678,6 +698,8 @@ _iface_route (int reqfd, int id, bool add, const struct in6_addr *addr,
+ "There is probably another tunnel with a conflicting route present\n"
+ "(see also FreeBSD PR kern/100080).\n"
+ "Please upgrade to FreeBSD 6.3 or more recent to fix this.\n");
++ else syslog (LOG_NOTICE,
++"Creating a route erorr: %s\n", strerror (errno));
+
+ (void)close (s);
+ #else
diff --git a/net/miredo/files/patch-misc-client-hook.bsd b/net/miredo/files/patch-misc-client-hook.bsd
new file mode 100644
index 000000000000..45980442de54
--- /dev/null
+++ b/net/miredo/files/patch-misc-client-hook.bsd
@@ -0,0 +1,28 @@
+--- misc/client-hook.bsd.orig 2009-04-10 01:34:15.000000000 +0900
++++ misc/client-hook.bsd 2009-06-23 17:15:54.000000000 +0900
+@@ -18,21 +18,13 @@
+
+ "$IFCONFIG" "$IFACE" "$STATE"
+
+-# FIXME: untested, certainly syntaxically incorrect
+-"$ROUTE" flush dev "$IFACE" 2>/dev/null
+-"$IFCONFIG" "$IFACE" flush 2>/dev/null
+-
+ case "$STATE" in
+ up)
+- # FIXME: untested, most likely syntaxically incorrect
+- "$IFCONFIG" "$IFACE" inet6 add "${LLADDRESS}/64"
+- "$IFCONFIG" "$IFACE" inet6 add "${ADDRESS}/32"
+- "$ROUTE" add -inet6 default "${LLADDRESS}%${IFACE}"
++ "$IFCONFIG" "$IFACE" inet6 "${LLADDRESS}/64"
++ "$IFCONFIG" "$IFACE" inet6 "${ADDRESS}/128"
++ "$ROUTE" delete -inet6 default
++ "$ROUTE" add -inet6 default -iface "$IFACE"
+ ;;
+ esac
+
+-# TODO: MacOS X should probably gets its fork of the script
+-# MacOS X DNS resolver must be reloaded when IPv6 availability changes
+-#/sbin/killall -HUP something
+-
+ exit 0
diff --git a/net/miredo/files/patch-src-relayd.c b/net/miredo/files/patch-src-relayd.c
new file mode 100644
index 000000000000..8b582ce3808d
--- /dev/null
+++ b/net/miredo/files/patch-src-relayd.c
@@ -0,0 +1,18 @@
+--- src/privproc.c
++++ src/privproc.c
+@@ -122,7 +122,6 @@ miredo_privileged_process (unsigned ifindex,
+ return -1;
+
+ case 0:
+- clean_cb (opaque);
+ close (fd[1]);
+ break;
+
+@@ -241,6 +240,7 @@ miredo_privileged_process (unsigned ifindex,
+ run_script ();
+ }
+
++ clean_cb (opaque);
+ exit (0);
+ }
+