Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37667483
en ru br
Репозитории ALT

Группа :: Система/Серверы
Пакет: openl2tp

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: openl2tp-1.8-tirpc.patch
Скачать


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
 
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;
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin