diff options
Diffstat (limited to 'net-dialup/openl2tp/files/openl2tp-1.8-tirpc.patch')
-rw-r--r-- | net-dialup/openl2tp/files/openl2tp-1.8-tirpc.patch | 53 |
1 files changed, 53 insertions, 0 deletions
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 000000000000..038d53c30d52 --- /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; |