The source is rather old and begins to stink. The following fixes
are needed to even compile:
 * multiline strings converted in avp.c call.c and network.c
 * remove superflous extern declaration of static variable

The following patches are to avoid (valid) warnings
 * possibly uninitialized variable in avp.c:handle_avps
 * add -Wno-pointer-sign to CFLAGS (braindead gcc handling)
 * rename the "log" function because it is a builtin now
 * remove unused variable in control.c:handle_packet (which only occurs
   in a big heap of commented out code)
Index: l2tpd/call.c
===================================================================
--- l2tpd.orig/call.c	2002-08-10 02:47:25.000000000 +0200
+++ l2tpd/call.c	2009-04-01 11:26:22.000000000 +0200
@@ -193,8 +193,8 @@ int read_packet (struct buffer *buf, int
         }
     }
     /* I should never get here */
-    log (LOG_WARN, "%s: You should not see this message.  If you do, please
-		       enter a bug report at http://sourceforge.net/projects/l2tpd", __FUNCTION__);
+    log (LOG_WARN, "%s: You should not see this message.  If you do, please "
+		       "enter a bug report at http://sourceforge.net/projects/l2tpd\n", __FUNCTION__);
     return -EINVAL;
 }
 
Index: l2tpd/network.c
===================================================================
--- l2tpd.orig/network.c	2009-04-01 11:25:39.000000000 +0200
+++ l2tpd/network.c	2009-04-01 11:26:22.000000000 +0200
@@ -362,7 +362,7 @@ void network_thread ()
                 extract (buf->start, &tunnel, &call);
                 if (debug_network)
                 {
-                    log (LOG_DEBUG, "%s: recv packet from %s, size = %d,
+                    log (LOG_DEBUG, "%s: recv packet from %s, size = %d,\n\
 tunnel = %d, call = %d\n", __FUNCTION__, inet_ntoa (from.sin_addr), recvsize, tunnel, call);
                 }
                 if (packet_dump)
Index: l2tpd/avp.c
===================================================================
--- l2tpd.orig/avp.c	2009-04-01 11:26:39.000000000 +0200
+++ l2tpd/avp.c	2009-04-01 11:44:53.000000000 +0200
@@ -1593,7 +1593,7 @@ int handle_avps (struct buffer *buf, str
     struct avp_hdr *avp;
     int len = buf->len - sizeof (struct control_hdr);
     int firstavp = -1;
-    int hidlen;
+    int hidlen = 0;
     char *data = buf->start + sizeof (struct control_hdr);
     avp = (struct avp_hdr *) data;
     if (debug_avp)
@@ -1608,7 +1608,7 @@ int handle_avps (struct buffer *buf, str
             if (AMBIT (avp->length))
             {
                 log (LOG_WARN,
-                     "%s:  dont know how to handle mandatory attribute %d.  Closing %s.\n"
+                     "%s:  dont know how to handle mandatory attribute %d.  Closing %s.\n",
                      __FUNCTION__, avp->attr,
                      (c != t->self) ? "call" : "tunnel");
                 set_error (c, VENDOR_ERROR,
Index: l2tpd/Makefile
===================================================================
--- l2tpd.orig/Makefile	2009-04-01 11:31:01.000000000 +0200
+++ l2tpd/Makefile	2009-04-01 11:31:14.000000000 +0200
@@ -27,7 +27,7 @@
 # become runtime options) debugging flags
 #
 #DFLAGS= -g -O2 -DDEBUG_PPPD
-DFLAGS= -g -O2 -DDEBUG_PPPD -DDEBUG_CONTROL -DDEBUG_ENTROPY
+DFLAGS= -g -Os -DDEBUG_PPPD -DDEBUG_CONTROL -DDEBUG_ENTROPY
 #
 # Uncomment the next line for Linux
 #
@@ -56,7 +56,7 @@ OSFLAGS= -DLINUX -I/usr/include
 
 FFLAGS= -DIP_ALLOCATION 
 
-CFLAGS= $(DFLAGS) -Wall -DSANITY $(OSFLAGS) $(FFLAGS)
+CFLAGS= $(DFLAGS) -Wall -Wno-pointer-sign -DSANITY $(OSFLAGS) $(FFLAGS)
 HDRS=l2tp.h avp.h misc.h control.h call.h scheduler.h file.h aaa.h md5.h
 OBJS=l2tpd.o pty.o misc.o control.o avp.o call.o network.o avpsend.o scheduler.o file.o aaa.o md5.o
 LIBS= $(OSLIB) # -lefence # efence for malloc checking
Index: l2tpd/aaa.h
===================================================================
--- l2tpd.orig/aaa.h	2009-04-01 11:33:20.000000000 +0200
+++ l2tpd/aaa.h	2009-04-01 11:33:37.000000000 +0200
@@ -46,7 +46,6 @@ struct challenge
 };
 
 extern struct lns *get_lns (struct tunnel *);
-extern struct addr_ent *uaddr[];
 extern unsigned int get_addr (struct iprange *);
 extern void reserve_addr (unsigned int);
 extern void unreserve_addr (unsigned int);
Index: l2tpd/misc.h
===================================================================
--- l2tpd.orig/misc.h	2009-04-01 11:34:57.000000000 +0200
+++ l2tpd/misc.h	2009-04-01 11:39:15.000000000 +0200
@@ -64,7 +64,8 @@ struct ppp_opts
 #define halt() printf("Halted.\n") ; for(;;)
 
 extern char hostname[];
-extern void log (int level, const char *fmt, ...);
+#define log mysyslog
+extern void mysyslog (int level, const char *fmt, ...);
 extern struct buffer *new_buf (int);
 extern void udppush_handler (int);
 extern int addfcs (struct buffer *buf);
Index: l2tpd/control.c
===================================================================
--- l2tpd.orig/control.c	2009-04-01 11:46:39.000000000 +0200
+++ l2tpd/control.c	2009-04-01 11:46:43.000000000 +0200
@@ -1661,7 +1661,6 @@ inline int handle_packet (struct buffer 
                           struct call *c)
 {
     int res;
-    struct timeval tv;
     if (CTBIT (*((_u16 *) buf->start)))
     {
         /* We have a control packet */

