xl2tpd: fix passing our CFLAGS
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 17 Mar 2014 17:14:29 +0000 (17:14 +0000)
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 17 Mar 2014 17:14:29 +0000 (17:14 +0000)
Signed-off-by: Florian Fainelli <florian@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/packages@39938 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/xl2tpd/Makefile
net/xl2tpd/patches/110-makefile_dont_build_pfc.patch
net/xl2tpd/patches/120-kernel-mode-l2tp.patch
net/xl2tpd/patches/130-no-kill-ipparam.patch
net/xl2tpd/patches/140-control_src_cflags.patch [new file with mode: 0644]

index 6d197d6..baf87db 100644 (file)
@@ -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.
index 90b320f..9a5b2b9 100644 (file)
@@ -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/
index 7a136d6..4014426 100644 (file)
@@ -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;
                                         * 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 */
  };
  
  /* 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 {
  
  
  
 +#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);
      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;
      };
  
      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)
        {
                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;
  
      /* 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 ();
          }
          {
              /*
               * 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. */
                      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 ()
                }
            };
        }
  
        /*
         * finished obvious sources, look for data from PPP connections.
-@@ -639,3 +674,82 @@
+@@ -639,3 +674,82 @@ void network_thread ()
      }
  
  }
 +}
 --- 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);
                  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;
  #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;
         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__);
             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);
          /* 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)
              {
  
          /* 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);
index 896d391..d0023d2 100644 (file)
@@ -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 (file)
index 0000000..518ba9e
--- /dev/null
@@ -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)