From de47e5b374874670d47f51f7e947e763c7f5510a Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Mon, 17 Mar 2014 17:14:29 +0000 Subject: [PATCH] xl2tpd: fix passing our CFLAGS Signed-off-by: Florian Fainelli SVN-Revision: 39938 --- net/xl2tpd/Makefile | 4 +- .../patches/110-makefile_dont_build_pfc.patch | 10 ++-- net/xl2tpd/patches/120-kernel-mode-l2tp.patch | 48 +++++++++---------- net/xl2tpd/patches/130-no-kill-ipparam.patch | 4 +- .../patches/140-control_src_cflags.patch | 11 +++++ 5 files changed, 44 insertions(+), 33 deletions(-) create mode 100644 net/xl2tpd/patches/140-control_src_cflags.patch diff --git a/net/xl2tpd/Makefile b/net/xl2tpd/Makefile index 6d197d65b0..baf87dbb6d 100644 --- a/net/xl2tpd/Makefile +++ b/net/xl2tpd/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2011 OpenWrt.org +# Copyright (C) 2006-2014 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xl2tpd PKG_VERSION:=1.3.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz # Host seems to be down. diff --git a/net/xl2tpd/patches/110-makefile_dont_build_pfc.patch b/net/xl2tpd/patches/110-makefile_dont_build_pfc.patch index 90b320f2ed..9a5b2b9a35 100644 --- a/net/xl2tpd/patches/110-makefile_dont_build_pfc.patch +++ b/net/xl2tpd/patches/110-makefile_dont_build_pfc.patch @@ -1,6 +1,6 @@ ---- a/Makefile 2011-08-16 20:28:19.968069040 +0200 -+++ b/Makefile 2011-08-16 20:27:57.968069032 +0200 -@@ -106,10 +106,10 @@ +--- a/Makefile ++++ b/Makefile +@@ -106,10 +106,10 @@ BINDIR?=$(DESTDIR)${PREFIX}/bin MANDIR?=$(DESTDIR)${PREFIX}/share/man @@ -13,7 +13,7 @@ $(EXEC): $(OBJS) $(HDRS) $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS) -@@ -117,14 +117,10 @@ +@@ -117,14 +117,10 @@ $(EXEC): $(OBJS) $(HDRS) $(CONTROL_EXEC): $(CONTROL_SRCS) $(CC) $(CONTROL_SRCS) -o $@ @@ -29,7 +29,7 @@ install -d -m 0755 ${SBINDIR} install -m 0755 $(EXEC) ${SBINDIR}/$(EXEC) install -d -m 0755 ${MANDIR}/man5 -@@ -132,11 +128,6 @@ +@@ -132,11 +128,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/ diff --git a/net/xl2tpd/patches/120-kernel-mode-l2tp.patch b/net/xl2tpd/patches/120-kernel-mode-l2tp.patch index 7a136d6114..4014426c8b 100644 --- a/net/xl2tpd/patches/120-kernel-mode-l2tp.patch +++ b/net/xl2tpd/patches/120-kernel-mode-l2tp.patch @@ -1,6 +1,6 @@ --- a/Makefile +++ b/Makefile -@@ -62,8 +62,8 @@ +@@ -62,8 +62,8 @@ OSFLAGS?= -DLINUX -I$(KERNELSRC)/include # are packages seperately (eg kernel-headers on Fedora) # Note: 2.6.23+ support still needs some changes in the xl2tpd source # @@ -13,7 +13,7 @@ # --- a/call.c +++ b/call.c -@@ -680,6 +680,8 @@ +@@ -680,6 +680,8 @@ struct call *get_call (int tunnel, int c st->peer.sin_port = port; st->refme = refme; st->refhim = refhim; @@ -24,7 +24,7 @@ tunnels.head = st; --- a/control.c +++ b/control.c -@@ -596,6 +596,9 @@ +@@ -596,6 +596,9 @@ int control_finish (struct tunnel *t, st if (gconfig.debug_state) l2tp_log (LOG_DEBUG, "%s: sending SCCCN\n", __FUNCTION__); control_xmit (buf); @@ -34,7 +34,7 @@ /* Schedule a HELLO */ tv.tv_sec = HELLO_DELAY; tv.tv_usec = 0; -@@ -608,6 +611,7 @@ +@@ -608,6 +611,7 @@ int control_finish (struct tunnel *t, st "Connection established to %s, %d. Local: %d, Remote: %d (ref=%u/%u).\n", IPADDY (t->peer.sin_addr), ntohs (t->peer.sin_port), t->ourtid, t->tid, t->refme, t->refhim); @@ -42,7 +42,7 @@ if (t->lac) { /* This is part of a LAC, so we want to go ahead -@@ -635,6 +639,9 @@ +@@ -635,6 +639,9 @@ int control_finish (struct tunnel *t, st IPADDY (t->peer.sin_addr), ntohs (t->peer.sin_port), t->ourtid, t->tid, t->refme, t->refhim, t->lns->entname); @@ -54,7 +54,7 @@ tv.tv_usec = 0; --- a/l2tp.h +++ b/l2tp.h -@@ -167,6 +167,8 @@ +@@ -167,6 +167,8 @@ struct tunnel int ourrws; /* Receive Window Size */ int rxspeed; /* Receive bps */ int txspeed; /* Transmit bps */ @@ -63,7 +63,7 @@ struct call *self; struct lns *lns; /* LNS that owns us */ struct lac *lac; /* LAC that owns us */ -@@ -220,6 +222,7 @@ +@@ -220,6 +222,7 @@ extern void control_xmit (void *); extern int ppd; extern int switch_io; /* jz */ extern int control_fd; @@ -105,7 +105,7 @@ * 0 => current */ int fd; /* FD of UDP socket to use */ -@@ -36,6 +31,45 @@ +@@ -36,6 +31,45 @@ struct pppol2tp_addr __u16 d_tunnel, d_session; /* For sending outgoing packets */ }; @@ -151,7 +151,7 @@ /* Socket options: * DEBUG - bitmask of debug message categories * SENDSEQ - 0 => don't send packets with sequence numbers -@@ -66,4 +100,4 @@ +@@ -66,4 +100,4 @@ enum { @@ -159,7 +159,7 @@ +#endif /* __LINUX_IF_PPPOL2TP_H */ --- a/network.c +++ b/network.c -@@ -45,6 +45,7 @@ +@@ -45,6 +45,7 @@ int init_network (void) server.sin_family = AF_INET; server.sin_addr.s_addr = gconfig.listenaddr; server.sin_port = htons (gconfig.port); @@ -167,7 +167,7 @@ if ((server_socket = socket (PF_INET, SOCK_DGRAM, 0)) < 0) { l2tp_log (LOG_CRIT, "%s: Unable to allocate socket. Terminating.\n", -@@ -52,6 +53,10 @@ +@@ -52,6 +53,10 @@ int init_network (void) return -EINVAL; }; @@ -178,7 +178,7 @@ if (bind (server_socket, (struct sockaddr *) &server, sizeof (server))) { close (server_socket); -@@ -321,6 +326,11 @@ +@@ -321,6 +326,11 @@ int build_fdset (fd_set *readfds) while (tun) { @@ -190,7 +190,7 @@ call = tun->call_head; while (call) { -@@ -390,6 +400,8 @@ +@@ -390,6 +400,8 @@ void network_thread () struct iovec iov; char cbuf[256]; unsigned int refme, refhim; @@ -199,7 +199,7 @@ /* This one buffer can be recycled for everything except control packets */ buf = new_buf (MAX_RECV_SIZE); -@@ -428,7 +440,21 @@ +@@ -428,7 +440,21 @@ void network_thread () { do_control (); } @@ -222,7 +222,7 @@ { /* * Okay, now we're ready for reading and processing new data. -@@ -457,12 +483,19 @@ +@@ -457,12 +483,19 @@ void network_thread () msgh.msg_flags = 0; /* Receive one packet. */ @@ -243,7 +243,7 @@ if (errno != EAGAIN) l2tp_log (LOG_WARNING, "%s: recvfrom returned error %d (%s)\n", -@@ -567,6 +600,8 @@ +@@ -567,6 +600,8 @@ void network_thread () } }; } @@ -252,7 +252,7 @@ /* * finished obvious sources, look for data from PPP connections. -@@ -639,3 +674,82 @@ +@@ -639,3 +674,82 @@ void network_thread () } } @@ -337,7 +337,7 @@ +} --- a/xl2tpd.c +++ b/xl2tpd.c -@@ -278,7 +278,11 @@ +@@ -278,7 +278,11 @@ void death_handler (int signal) struct tunnel *st, *st2; int sec; l2tp_log (LOG_CRIT, "%s: Fatal signal %d received\n", __FUNCTION__, signal); @@ -349,7 +349,7 @@ st = tunnels.head; while (st) { -@@ -349,7 +353,7 @@ +@@ -349,7 +353,7 @@ int start_pppd (struct call *c, struct p int flags; #endif int pos = 1; @@ -358,7 +358,7 @@ #ifdef DEBUG_PPPD int x; #endif -@@ -397,7 +401,7 @@ +@@ -397,7 +401,7 @@ int start_pppd (struct call *c, struct p sax.sa_family = AF_PPPOX; sax.sa_protocol = PX_PROTO_OL2TP; sax.pppol2tp.pid = 0; @@ -367,7 +367,7 @@ sax.pppol2tp.addr.sin_addr.s_addr = c->container->peer.sin_addr.s_addr; sax.pppol2tp.addr.sin_port = c->container->peer.sin_port; sax.pppol2tp.addr.sin_family = AF_INET; -@@ -408,6 +412,7 @@ +@@ -408,6 +412,7 @@ int start_pppd (struct call *c, struct p if (connect(fd2, (struct sockaddr *)&sax, sizeof(sax)) < 0) { l2tp_log (LOG_WARNING, "%s: Unable to connect PPPoL2TP socket.\n", __FUNCTION__); @@ -375,7 +375,7 @@ return -EINVAL; } stropt[pos++] = strdup ("plugin"); -@@ -484,7 +489,7 @@ +@@ -484,7 +489,7 @@ int start_pppd (struct call *c, struct p dup2 (fd2, 0); dup2 (fd2, 1); close(fd2); @@ -384,7 +384,7 @@ /* close all the calls pty fds */ st = tunnels.head; while (st) -@@ -492,12 +497,17 @@ +@@ -492,12 +497,17 @@ int start_pppd (struct call *c, struct p sc = st->call_head; while (sc) { @@ -404,7 +404,7 @@ /* close the UDP socket fd */ close (server_socket); -@@ -615,6 +625,10 @@ +@@ -615,6 +625,10 @@ void destroy_tunnel (struct tunnel *t) the memory pointed to by t->chal_us.vector at some other place */ if (t->chal_them.vector) free (t->chal_them.vector); diff --git a/net/xl2tpd/patches/130-no-kill-ipparam.patch b/net/xl2tpd/patches/130-no-kill-ipparam.patch index 896d391993..d0023d290f 100644 --- a/net/xl2tpd/patches/130-no-kill-ipparam.patch +++ b/net/xl2tpd/patches/130-no-kill-ipparam.patch @@ -1,5 +1,5 @@ ---- xl2tpd-1.3.1/control.c.orig 2012-04-25 12:59:28.718825985 +0100 -+++ xl2tpd-1.3.1/control.c 2012-04-25 12:59:37.063916785 +0100 +--- a/control.c ++++ b/control.c @@ -905,8 +905,6 @@ int control_finish (struct tunnel *t, st po = add_opt (po, c->lac->pppoptfile); } diff --git a/net/xl2tpd/patches/140-control_src_cflags.patch b/net/xl2tpd/patches/140-control_src_cflags.patch new file mode 100644 index 0000000000..518ba9ead0 --- /dev/null +++ b/net/xl2tpd/patches/140-control_src_cflags.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -115,7 +115,7 @@ $(EXEC): $(OBJS) $(HDRS) + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS) + + $(CONTROL_EXEC): $(CONTROL_SRCS) +- $(CC) $(CONTROL_SRCS) -o $@ ++ $(CC) $(CFLAGS) $(CONTROL_SRCS) -o $@ + + romfs: + $(ROMFSINST) /bin/$(EXEC) -- 2.30.2