pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/net/openvpn openvpn: fix for NetBSD with subnet topolo...
details: https://anonhg.NetBSD.org/pkgsrc/rev/dfea610093f3
branches: trunk
changeset: 309793:dfea610093f3
user: adam <adam%pkgsrc.org@localhost>
date: Sun Jun 24 09:26:12 2018 +0000
description:
openvpn: fix for NetBSD with subnet topology; remove empty DIST_SUBDIR
diffstat:
net/openvpn/Makefile | 5 +-
net/openvpn/distinfo | 3 +-
net/openvpn/patches/patch-src_openvpn_tun.c | 58 +++++++++++++++++++++++++++++
3 files changed, 62 insertions(+), 4 deletions(-)
diffs (93 lines):
diff -r 3782293310b2 -r dfea610093f3 net/openvpn/Makefile
--- a/net/openvpn/Makefile Sun Jun 24 09:20:03 2018 +0000
+++ b/net/openvpn/Makefile Sun Jun 24 09:26:12 2018 +0000
@@ -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@localhost
HOMEPAGE= http://openvpn.net/
diff -r 3782293310b2 -r dfea610093f3 net/openvpn/distinfo
--- a/net/openvpn/distinfo Sun Jun 24 09:20:03 2018 +0000
+++ b/net/openvpn/distinfo Sun Jun 24 09:26:12 2018 +0000
@@ -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 @@
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 -r 3782293310b2 -r dfea610093f3 net/openvpn/patches/patch-src_openvpn_tun.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/openvpn/patches/patch-src_openvpn_tun.c Sun Jun 24 09:26:12 2018 +0000
@@ -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,
Home |
Main Index |
Thread Index |
Old Index