xl2tpd: update to 1.3.10
lock is no longer needed and it breaks the setup explicit added PKG_BUILD_DEPENDS:=libpcap, an indirect depend included in ppp and needed for pfc Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
This commit is contained in:
parent
d57926cfea
commit
2e5a59c5b4
6 changed files with 6 additions and 167 deletions
|
@ -8,8 +8,8 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=xl2tpd
|
PKG_NAME:=xl2tpd
|
||||||
PKG_VERSION:=devel-20151125
|
PKG_VERSION:=1.3.10
|
||||||
PKG_RELEASE:=3
|
PKG_RELEASE:=1
|
||||||
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
|
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
|
||||||
PKG_LICENSE:=GPL-2.0
|
PKG_LICENSE:=GPL-2.0
|
||||||
PKG_LICENSE_FILES:=LICENSE
|
PKG_LICENSE_FILES:=LICENSE
|
||||||
|
@ -17,9 +17,11 @@ PKG_LICENSE_FILES:=LICENSE
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_URL:=https://github.com/xelerance/xl2tpd.git
|
PKG_SOURCE_URL:=https://github.com/xelerance/xl2tpd.git
|
||||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||||
PKG_SOURCE_VERSION:=e2065bf0fc22ba33001ad503c01bba01648024a8
|
PKG_SOURCE_VERSION:=090d1bef577cabdb3495d76acd814733fa66ef57
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_MIRROR_HASH:=8b15c0069cdab7080796f92f86c84b79e430679ce77fb6ea95749fe932bb87c4
|
PKG_MIRROR_HASH:=bcddc10e28a74dec607e67cbbea97220f6bfd696b0378a7c30ec8a3e0ac86be1
|
||||||
|
|
||||||
|
PKG_BUILD_DEPENDS:=libpcap
|
||||||
|
|
||||||
PKG_INSTALL:=1
|
PKG_INSTALL:=1
|
||||||
|
|
||||||
|
@ -40,9 +42,6 @@ It does implement both LAC and LNS role in a L2TP networking architecture. The
|
||||||
main goal of this protocol is to tunnel PPP frame trough an IP network.
|
main goal of this protocol is to tunnel PPP frame trough an IP network.
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# Use optimization options from OpenWrt build system
|
|
||||||
MAKE_FLAGS += OFLAGS=""
|
|
||||||
|
|
||||||
ifneq (0,0)
|
ifneq (0,0)
|
||||||
# debugging options from Makefile of xl2tpd package
|
# debugging options from Makefile of xl2tpd package
|
||||||
EXTRA_CFLAGS += \
|
EXTRA_CFLAGS += \
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
lock
|
|
||||||
noauth
|
noauth
|
||||||
debug
|
debug
|
||||||
dump
|
dump
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
--- a/Makefile
|
|
||||||
+++ b/Makefile
|
|
||||||
@@ -97,7 +97,8 @@ OSFLAGS+= -DUSE_KERNEL
|
|
||||||
|
|
||||||
IPFLAGS?= -DIP_ALLOCATION
|
|
||||||
|
|
||||||
-CFLAGS+= $(DFLAGS) -Os -fno-builtin -Wall -DSANITY $(OSFLAGS) $(IPFLAGS)
|
|
||||||
+OFLAGS=-Os
|
|
||||||
+CFLAGS+= $(DFLAGS) $(OFLAGS) -fno-builtin -Wall -DSANITY $(OSFLAGS) $(IPFLAGS)
|
|
||||||
HDRS=l2tp.h avp.h misc.h control.h call.h scheduler.h file.h aaa.h md5.h
|
|
||||||
OBJS=xl2tpd.o pty.o misc.o control.o avp.o call.o network.o avpsend.o scheduler.o file.o aaa.o md5.o
|
|
||||||
SRCS=${OBJS:.o=.c} ${HDRS}
|
|
|
@ -1,43 +0,0 @@
|
||||||
--- a/Makefile
|
|
||||||
+++ b/Makefile
|
|
||||||
@@ -113,10 +113,10 @@ BINDIR?=$(DESTDIR)${PREFIX}/bin
|
|
||||||
MANDIR?=$(DESTDIR)${PREFIX}/share/man
|
|
||||||
|
|
||||||
|
|
||||||
-all: $(EXEC) pfc $(CONTROL_EXEC)
|
|
||||||
+all: $(EXEC) $(CONTROL_EXEC)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
- rm -f $(OBJS) $(EXEC) pfc.o pfc $(CONTROL_EXEC)
|
|
||||||
+ rm -f $(OBJS) $(EXEC) $(CONTROL_EXEC)
|
|
||||||
|
|
||||||
$(EXEC): $(OBJS) $(HDRS)
|
|
||||||
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
|
|
||||||
@@ -124,14 +124,10 @@ $(EXEC): $(OBJS) $(HDRS)
|
|
||||||
$(CONTROL_EXEC): $(CONTROL_SRCS)
|
|
||||||
$(CC) $(CFLAGS) $(LDFLAGS) $(CONTROL_SRCS) -o $@
|
|
||||||
|
|
||||||
-pfc:
|
|
||||||
- $(CC) $(CFLAGS) -c contrib/pfc.c
|
|
||||||
- $(CC) $(LDFLAGS) -o pfc pfc.o -lpcap $(LDLIBS)
|
|
||||||
-
|
|
||||||
romfs:
|
|
||||||
$(ROMFSINST) /bin/$(EXEC)
|
|
||||||
|
|
||||||
-install: ${EXEC} pfc ${CONTROL_EXEC}
|
|
||||||
+install: ${EXEC} ${CONTROL_EXEC}
|
|
||||||
install -d -m 0755 ${SBINDIR}
|
|
||||||
install -m 0755 $(EXEC) ${SBINDIR}/$(EXEC)
|
|
||||||
install -d -m 0755 ${MANDIR}/man5
|
|
||||||
@@ -139,11 +135,6 @@ install: ${EXEC} pfc ${CONTROL_EXEC}
|
|
||||||
install -m 0644 doc/xl2tpd.8 ${MANDIR}/man8/
|
|
||||||
install -m 0644 doc/xl2tpd.conf.5 doc/l2tp-secrets.5 \
|
|
||||||
${MANDIR}/man5/
|
|
||||||
- # pfc
|
|
||||||
- install -d -m 0755 ${BINDIR}
|
|
||||||
- install -m 0755 pfc ${BINDIR}/pfc
|
|
||||||
- install -d -m 0755 ${MANDIR}/man1
|
|
||||||
- install -m 0644 contrib/pfc.1 ${MANDIR}/man1/
|
|
||||||
# control exec
|
|
||||||
install -d -m 0755 ${SBINDIR}
|
|
||||||
install -m 0755 $(CONTROL_EXEC) ${SBINDIR}/$(CONTROL_EXEC)
|
|
|
@ -1,11 +0,0 @@
|
||||||
--- a/xl2tpd.c
|
|
||||||
+++ b/xl2tpd.c
|
|
||||||
@@ -30,7 +30,7 @@
|
|
||||||
#include <errno.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <time.h>
|
|
||||||
-#if (__GLIBC__ < 2)
|
|
||||||
+#if defined (__GLIBC__) && (__GLIBC__ < 2)
|
|
||||||
# if defined(FREEBSD) || defined(OPENBSD)
|
|
||||||
# include <sys/signal.h>
|
|
||||||
# elif defined(LINUX)
|
|
|
@ -1,92 +0,0 @@
|
||||||
From 97adf987cf230e47a4800c2f0a0940a1d0d98109 Mon Sep 17 00:00:00 2001
|
|
||||||
From: wendy2001011 <wendy2001011@163.com>
|
|
||||||
Date: Thu, 9 Feb 2017 17:32:14 +0800
|
|
||||||
Subject: [PATCH] xl2tpd-control: fix xl2tpd hanged up in "fopen"
|
|
||||||
|
|
||||||
This is a fix for xl2tpd hanged up in "fopen" result fifo while working
|
|
||||||
on xl2tpd with OpenWrt.
|
|
||||||
|
|
||||||
Root cause is as followings,
|
|
||||||
1. xl2tpd-control open result fifo ##fifo readers=1
|
|
||||||
2. xl2tpd-control read result fifo
|
|
||||||
3. xl2tpd-control close result fifo ##fifo readers=0
|
|
||||||
4. xl2tpd fopen result fifo ##xl2tpd is hanged up here to wait readers
|
|
||||||
5. xl2tpd-control unlink result fifo
|
|
||||||
|
|
||||||
The fix replaces the order of "unlink" and "close" when cleaning up to
|
|
||||||
avoid hang up issue in fopen, and add the retry waiting when reading
|
|
||||||
result fifo.
|
|
||||||
|
|
||||||
[Yousong Zhou: 2s as the timeout and 10ms as the check interval]
|
|
||||||
---
|
|
||||||
xl2tpd-control.c | 23 +++++++++++++++++++++--
|
|
||||||
1 file changed, 21 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/xl2tpd-control.c b/xl2tpd-control.c
|
|
||||||
index 9fcab76..b8bf822 100644
|
|
||||||
--- a/xl2tpd-control.c
|
|
||||||
+++ b/xl2tpd-control.c
|
|
||||||
@@ -35,6 +35,7 @@
|
|
||||||
|
|
||||||
#define TUNNEL_REQUIRED 1
|
|
||||||
#define TUNNEL_NOT_REQUIRED 0
|
|
||||||
+#define TIMEOUT 2000000 //timeout is 2s
|
|
||||||
|
|
||||||
char result_filename[128];
|
|
||||||
int result_fd = -1;
|
|
||||||
@@ -149,9 +150,9 @@ void help()
|
|
||||||
void cleanup(void)
|
|
||||||
{
|
|
||||||
/* cleaning up */
|
|
||||||
- if (result_fd >= 0)
|
|
||||||
- close (result_fd);
|
|
||||||
unlink (result_filename);
|
|
||||||
+ if (result_fd >= 0)
|
|
||||||
+ close (result_fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main (int argc, char *argv[])
|
|
||||||
@@ -340,6 +341,7 @@ void print_error (int level, const char *fmt, ...)
|
|
||||||
va_end (args);
|
|
||||||
}
|
|
||||||
|
|
||||||
+
|
|
||||||
int read_result(int result_fd, char* buf, ssize_t size)
|
|
||||||
{
|
|
||||||
/* read result from result_fd */
|
|
||||||
@@ -348,6 +350,11 @@ int read_result(int result_fd, char* buf, ssize_t size)
|
|
||||||
*/
|
|
||||||
ssize_t readed = 0;
|
|
||||||
ssize_t len;
|
|
||||||
+ int write_pipe = 0;
|
|
||||||
+ struct timeval tvs;
|
|
||||||
+ struct timeval tve;
|
|
||||||
+ unsigned long diff;
|
|
||||||
+ gettimeofday(&tvs, NULL);
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
@@ -360,8 +367,20 @@ int read_result(int result_fd, char* buf, ssize_t size)
|
|
||||||
"error: can't read command result: %s\n", strerror (errno));
|
|
||||||
break;
|
|
||||||
} else if (len == 0) {
|
|
||||||
+ if(!write_pipe) {
|
|
||||||
+ gettimeofday(&tve, NULL);
|
|
||||||
+ diff = (tve.tv_sec - tvs.tv_sec) * 1000000 + (tve.tv_usec - tvs.tv_usec);
|
|
||||||
+ if (diff >= TIMEOUT) {
|
|
||||||
+ print_error (DEBUG_LEVEL, "error: read timout\n");
|
|
||||||
+ break;
|
|
||||||
+ } else {
|
|
||||||
+ usleep(10000);
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
+ write_pipe = 1;
|
|
||||||
readed += len;
|
|
||||||
if ((size - readed) <= 0)
|
|
||||||
break;
|
|
||||||
--
|
|
||||||
2.6.4
|
|
||||||
|
|
Loading…
Reference in a new issue