diff options
author | adam <adam@pkgsrc.org> | 2018-06-24 09:26:12 +0000 |
---|---|---|
committer | adam <adam@pkgsrc.org> | 2018-06-24 09:26:12 +0000 |
commit | a72239730b39892fa96fd6c622b7d1f8078810e2 (patch) | |
tree | 9874e3a7bf4b12d6753424cada9b1dbac0960536 /net/openvpn | |
parent | 37d6f826bbcc6f427864a5f93fbd55c933b018cd (diff) | |
download | pkgsrc-a72239730b39892fa96fd6c622b7d1f8078810e2.tar.gz |
openvpn: fix for NetBSD with subnet topology; remove empty DIST_SUBDIR
Diffstat (limited to 'net/openvpn')
-rw-r--r-- | net/openvpn/Makefile | 5 | ||||
-rw-r--r-- | net/openvpn/distinfo | 3 | ||||
-rw-r--r-- | net/openvpn/patches/patch-src_openvpn_tun.c | 58 |
3 files changed, 62 insertions, 4 deletions
diff --git a/net/openvpn/Makefile b/net/openvpn/Makefile index 6cd441cca1e..1788e040cb8 100644 --- a/net/openvpn/Makefile +++ b/net/openvpn/Makefile @@ -1,11 +1,10 @@ -# $NetBSD: Makefile,v 1.65 2018/04/27 06:40:28 adam Exp $ +# $NetBSD: Makefile,v 1.66 2018/06/24 09:26:12 adam Exp $ DISTNAME= ${OPENVPN_DISTNAME} +PKGREVISION= 1 CATEGORIES= net MASTER_SITES= ${OPENVPN_MASTER_SITES} EXTRACT_SUFX= .tar.xz -# Remove DIST_SUBDIR on next update -DIST_SUBDIR= ${OPENVPN_DIST_SUBDIR} MAINTAINER= pkgsrc-users@NetBSD.org HOMEPAGE= http://openvpn.net/ diff --git a/net/openvpn/distinfo b/net/openvpn/distinfo index f0fef033380..471d4cd2158 100644 --- a/net/openvpn/distinfo +++ b/net/openvpn/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.41 2018/04/27 06:40:28 adam Exp $ +$NetBSD: distinfo,v 1.42 2018/06/24 09:26:12 adam Exp $ SHA1 (openvpn-2.4.6.tar.xz) = 4742492867df31aadc0aeea5c8b4422d1a624e69 RMD160 (openvpn-2.4.6.tar.xz) = 9fb17a39b70d96ecc3075a78011496b239e741d6 @@ -6,3 +6,4 @@ SHA512 (openvpn-2.4.6.tar.xz) = da4301a4655a5bc224de59ba74fe15005ea856cc43b404aa Size (openvpn-2.4.6.tar.xz) = 943376 bytes SHA1 (patch-configure) = 240342a88baed7642dfd63ed0a2ab4c0a75adbd4 SHA1 (patch-src_compat_compat-basename.c) = 45a58ef2e05f6e0265f229da8540760e60e65143 +SHA1 (patch-src_openvpn_tun.c) = 32b52e0ecd4f8a190bc3c87b49da30e40fb7f241 diff --git a/net/openvpn/patches/patch-src_openvpn_tun.c b/net/openvpn/patches/patch-src_openvpn_tun.c new file mode 100644 index 00000000000..5d7149a3a24 --- /dev/null +++ b/net/openvpn/patches/patch-src_openvpn_tun.c @@ -0,0 +1,58 @@ +$NetBSD: patch-src_openvpn_tun.c,v 1.1 2018/06/24 09:26:12 adam Exp $ + +Fix for NetBSD with subnet topology. + +--- src/openvpn/tun.c.orig 2018-06-24 07:38:24.000000000 +0000 ++++ src/openvpn/tun.c +@@ -845,7 +845,7 @@ delete_route_connected_v6_net(struct tun + #endif /* if defined(_WIN32) || defined(TARGET_DARWIN) || defined(TARGET_NETBSD) || defined(TARGET_OPENBSD) */ + + #if defined(TARGET_FREEBSD) || defined(TARGET_DRAGONFLY) \ +- || defined(TARGET_OPENBSD) ++ || defined(TARGET_NETBSD) || defined(TARGET_OPENBSD) + /* we can't use true subnet mode on tun on all platforms, as that + * conflicts with IPv6 (wants to use ND then, which we don't do), + * but the OSes want "a remote address that is different from ours" +@@ -1269,6 +1269,8 @@ do_ifconfig(struct tuntap *tt, + + #elif defined(TARGET_NETBSD) + ++ in_addr_t remote_end; /* for "virtual" subnet topology */ ++ + if (tun) + { + argv_printf(&argv, +@@ -1282,12 +1284,13 @@ do_ifconfig(struct tuntap *tt, + } + else if (tt->topology == TOP_SUBNET) + { ++ remote_end = create_arbitrary_remote( tt ); + argv_printf(&argv, + "%s %s %s %s mtu %d netmask %s up", + IFCONFIG_PATH, + actual, + ifconfig_local, +- ifconfig_local, ++ print_in_addr_t(remote_end, 0, &gc), + tun_mtu, + ifconfig_remote_netmask + ); +@@ -1312,6 +1315,18 @@ do_ifconfig(struct tuntap *tt, + argv_msg(M_INFO, &argv); + openvpn_execve_check(&argv, es, S_FATAL, "NetBSD ifconfig failed"); + ++ /* Add a network route for the local tun interface */ ++ if (!tun && tt->topology == TOP_SUBNET) ++ { ++ struct route_ipv4 r; ++ CLEAR(r); ++ r.flags = RT_DEFINED; ++ r.network = tt->local & tt->remote_netmask; ++ r.netmask = tt->remote_netmask; ++ r.gateway = remote_end; ++ add_route(&r, tt, 0, NULL, es); ++ } ++ + if (do_ipv6) + { + argv_printf(&argv, |