summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net-dialup/openl2tp/files/openl2tp-1.8-cflags.patch29
-rw-r--r--net-dialup/openl2tp/files/openl2tp-1.8-tirpc.patch53
-rw-r--r--net-dialup/openl2tp/metadata.xml2
-rw-r--r--net-dialup/openl2tp/openl2tp-1.8-r8.ebuild (renamed from net-dialup/openl2tp/openl2tp-1.8-r7.ebuild)17
4 files changed, 87 insertions, 14 deletions
diff --git a/net-dialup/openl2tp/files/openl2tp-1.8-cflags.patch b/net-dialup/openl2tp/files/openl2tp-1.8-cflags.patch
index 8a6ddf4..fe88257 100644
--- a/net-dialup/openl2tp/files/openl2tp-1.8-cflags.patch
+++ b/net-dialup/openl2tp/files/openl2tp-1.8-cflags.patch
@@ -1,11 +1,12 @@
---- openl2tp-1.8/Makefile.orig 2018-03-17 14:24:57.000000000 +0300
-+++ openl2tp-1.8/Makefile 2018-03-17 15:07:29.794479939 +0300
-@@ -153,14 +155,14 @@
+diff -Naurd openl2tp-1.8.orig/Makefile openl2tp-1.8/Makefile
+--- openl2tp-1.8.orig/Makefile 2018-07-03 04:59:51.000000000 +0900
++++ openl2tp-1.8/Makefile 2018-07-03 05:00:44.133460163 +0900
+@@ -155,24 +155,23 @@
endif
CPPFLAGS= $(CPPFLAGS.l2tptest) $(CPPFLAGS-y)
-CFLAGS= -I. -Iusl -Icli -isystem include \
-+CFLAGS+= -I. -Iusl -Icli -isystem include \
++CFLAGS+= -I. -Iusl -Icli -isystem include \
-MMD -Wall -Wno-strict-aliasing \
$(CPPFLAGS) $(CPPFLAGS.dmalloc) \
-DSYS_LIBDIR=$(SYS_LIBDIR)
@@ -13,7 +14,21 @@
LDFLAGS.l2tpconfig= -Lcli -lcli -lreadline $(LIBS.dmalloc) $(READLINE_LDFLAGS) -lc
-OPT_CFLAGS?= -O
-+OPT_CFLAGS?=
-
+-
ifeq ($(L2TP_DEBUG),y)
- CFLAGS.optimize= -g
+-CFLAGS.optimize= -g
+-CFLAGS.optimize+= -DDEBUG
++CFLAGS.opt= -g
++CFLAGS.opt+= -DDEBUG
+ else
+-CFLAGS.optimize= $(OPT_CFLAGS)
++CFLAGS.opt= $(OPT_CFLAGS)
+ endif
++CFLAGS.optimize= $(CFLAGS) $(CFLAGS.opt)
+ export CFLAGS.optimize
+
+-CFLAGS+= $(CFLAGS.optimize)
++CFLAGS+= $(CFLAGS.opt)
+
+ ifeq ($(L2TP_USE_ASYNC_RPC),y)
+ CPPFLAGS+= -DL2TP_ASYNC_RPC
diff --git a/net-dialup/openl2tp/files/openl2tp-1.8-tirpc.patch b/net-dialup/openl2tp/files/openl2tp-1.8-tirpc.patch
new file mode 100644
index 0000000..038d53c
--- /dev/null
+++ b/net-dialup/openl2tp/files/openl2tp-1.8-tirpc.patch
@@ -0,0 +1,53 @@
+diff -Naurd openl2tp-1.8.orig/Makefile openl2tp-1.8/Makefile
+--- openl2tp-1.8.orig/Makefile 2018-07-03 05:02:39.734741959 +0900
++++ openl2tp-1.8/Makefile 2018-07-03 05:01:52.071450387 +0900
+@@ -159,8 +159,8 @@
+ -MMD -Wall -Wno-strict-aliasing \
+ $(CPPFLAGS) $(CPPFLAGS.dmalloc) \
+ -DSYS_LIBDIR=$(SYS_LIBDIR)
+-LDFLAGS.l2tpd= -Wl,-E -L. -Lusl -lusl -ldl $(LIBS.dmalloc) -lc
++LDFLAGS.l2tpd= -Wl,-E -L. -Lusl -lusl -ldl -ltirpc $(LIBS.dmalloc) -lc
+-LDFLAGS.l2tpconfig= -Lcli -lcli -lreadline $(LIBS.dmalloc) $(READLINE_LDFLAGS) -lc
++LDFLAGS.l2tpconfig= -Lcli -lcli -lreadline -ltirpc $(LIBS.dmalloc) $(READLINE_LDFLAGS) -lc
+
+ ifeq ($(L2TP_DEBUG),y)
+ CFLAGS.opt= -g
+@@ -168,6 +168,7 @@
+ else
+ CFLAGS.opt= $(OPT_CFLAGS)
+ endif
++CFLAGS.opt+= -isystem /usr/include/tirpc
+ CFLAGS.optimize= $(CFLAGS) $(CFLAGS.opt)
+ export CFLAGS.optimize
+
+diff -Naurd openl2tp-1.8.orig/l2tp_api.c openl2tp-1.8/l2tp_api.c
+--- openl2tp-1.8.orig/l2tp_api.c 2018-07-03 04:59:47.000000000 +0900
++++ openl2tp-1.8/l2tp_api.c 2018-07-03 05:01:52.073450358 +0900
+@@ -25,6 +25,7 @@
+
+ #include <rpc/pmap_clnt.h>
+ #include <net/ethernet.h>
++#include <netinet/in.h>
+
+ #include "usl.h"
+
+@@ -443,14 +443,16 @@
+ */
+ int l2tp_api_rpc_check_request(SVCXPRT *xprt)
+ {
++ char straddr[INET6_ADDRSTRLEN];
+ /* If remote RPC is not enabled and the request is from a
+ * non-loopback interface, reject the request.
+ */
+ if ((!l2tp_opt_remote_rpc) &&
+- ((xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK)) &&
+- (xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_ANY)))) {
++ memcmp(&xprt->xp_raddr.sin6_addr, &in6addr_loopback, 16) &&
++ memcmp(&xprt->xp_raddr.sin6_addr, &in6addr_any, 16)) {
+ if (l2tp_opt_trace_flags & L2TP_DEBUG_API) {
+- l2tp_log(LOG_ERR, "Rejecting RPC request from %s", inet_ntoa(xprt->xp_raddr.sin_addr));
++ l2tp_log(LOG_ERR, "Rejecting RPC request from %s",
++ inet_ntop(AF_INET6, &xprt->xp_raddr.sin6_addr, straddr, INET6_ADDRSTRLEN));
+ }
+ svcerr_auth(xprt, AUTH_TOOWEAK);
+ return -EPERM;
diff --git a/net-dialup/openl2tp/metadata.xml b/net-dialup/openl2tp/metadata.xml
index 4d28915..5f1b920 100644
--- a/net-dialup/openl2tp/metadata.xml
+++ b/net-dialup/openl2tp/metadata.xml
@@ -8,7 +8,7 @@
<use>
<flag name='client'>Enable l2tp client.</flag>
<flag name='dmalloc'>Enable debugging using <pkg>dev-libs/dmalloc</pkg>.</flag>
- <flag name='rpc'>Enable RPC queries and control. This flag is required for
+ <flag name='rpc'>Enable RPC control management. This flag is required for
l2tpconfig to be built and used.</flag>
<flag name='server'>Enable l2tp server.</flag>
<flag name='stats'>Enable status files. Note: when they are used, this
diff --git a/net-dialup/openl2tp/openl2tp-1.8-r7.ebuild b/net-dialup/openl2tp/openl2tp-1.8-r8.ebuild
index 40ab572..fc70c13 100644
--- a/net-dialup/openl2tp/openl2tp-1.8-r7.ebuild
+++ b/net-dialup/openl2tp/openl2tp-1.8-r8.ebuild
@@ -20,17 +20,16 @@ CDEPEND="
>=net-dialup/ppp-2.4.5
sys-libs/readline:=
dmalloc? ( dev-libs/dmalloc )
- "
+"
DEPEND="${CDEPEND}
+ net-libs/libtirpc
+ >=net-libs/rpcsvc-proto-1.3.1-r1
sys-devel/bison
sys-devel/flex
- rpc? ( || (
- net-libs/rpcsvc-proto
- sys-devel/glibc[rpc]
- ) )"
+"
RDEPEND="${CDEPEND}
rpc? ( net-nds/rpcbind )
- "
+"
CONFIG_CHECK="~PPPOL2TP"
@@ -47,8 +46,14 @@ PATCHES=(
"${FILESDIR}/${P}-unused-var.patch"
"${FILESDIR}/${P}-configure-Makefile.patch"
"${FILESDIR}/${P}-cflags.patch"
+ "${FILESDIR}/${P}-tirpc.patch"
)
+src_prepare() {
+ default
+ sed -i 's/CFLAGS.optimize/CFLAGS_optimize/g' Makefile */Makefile || die "Makefile sed failed"
+}
+
src_configure() {
declare -a myconf # not local, should be used at src_compile()