1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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;
|