--- l2tpd-0.67.orig/Makefile
+++ l2tpd-0.67/Makefile
@@ -26,7 +26,7 @@
 # become runtime options) debugging flags
 #
 #DFLAGS= -g -O2 -DDEBUG_PPPD
-DFLAGS= -g -O2 -DDEBUG_PPPD -DDEBUG_CONTROL
+DFLAGS= -g -O2 -Wall -DDEBUG_PPPD -DDEBUG_CONTROL
 #
 # Uncomment the next line for Linux
 #
--- l2tpd-0.67.orig/avp.c
+++ l2tpd-0.67/avp.c
@@ -836,7 +836,7 @@
                  __FUNCTION__, size);
         size = MAXSTRLEN - 1;
     }
-    safe_copy (t->hostname, (char *) &raw[3], size);
+    safe_copy (t->hostname, (char *) &raw[3], size - 6);
     if (debug_avp)
     {
         if (DEBUG)
--- l2tpd-0.67.orig/l2tpd.c
+++ l2tpd-0.67/l2tpd.c
@@ -19,6 +19,7 @@
 #include <stdio.h>
 #include <errno.h>
 #include <unistd.h>
+#include <time.h>
 #if (__GLIBC__ < 2)
 # if defined(FREEBSD)
 #  include <sys/signal.h>
@@ -1034,7 +1035,10 @@
 void init (int argc,char *argv[])
 {
     struct lac *lac;
+    time_t seconds;
     init_args (argc,argv);
+    seconds = time(NULL);
+    srand(seconds);
     init_addr ();
     if (init_config ())
     {
--- l2tpd-0.67.orig/scheduler.c
+++ l2tpd-0.67/scheduler.c
@@ -26,7 +26,7 @@
 {
     struct sigaction act;
     act.sa_handler = alarm_handler;
-#ifdef LINUX
+#if defined(LINUX) && defined(__i386__)
     act.sa_restorer = NULL;
 #endif
     act.sa_flags = 0;
--- l2tpd-0.67.orig/debian/changelog
+++ l2tpd-0.67/debian/changelog
@@ -0,0 +1,40 @@
+l2tpd (0.67-1.1) stable-security; urgency=high
+
+  * Seed rand() with time() at program startup
+  * Fix some off by 6 errors in avp handling (included from 0.68)
+
+ -- Martin Schulze <joey@infodrom.org>  Tue, 13 Aug 2002 19:52:13 +0200
+
+l2tpd (0.67-1) unstable; urgency=low
+
+  * New upstream version (0-67).
+  * Added support for daemon mode (integrated in upstream).
+  * Added support for command line parameters (integrated in upstream).
+  * Added support for pid file (integrated in upstream).
+  * Fixed init script to handle pid file.
+  * Changed maintainer address.
+
+ -- Jean-Francois Dive <jef@debian.org>  Tue, 16 Apr 2002 17:25:11 +1000
+
+l2tpd (0.66-1) unstable; urgency=low
+
+  * New upstream version (0-66) (Closes: #141049),
+    mainly fixes control tunnel authentication.
+
+ -- Jean-Francois Dive <jef@linuxbe.org>  Mon,  8 Apr 2002 21:30:37 +1000
+
+l2tpd (0.65-1-1) unstable; urgency=low
+
+  * Fixed startup script problem (Closes: #137761).
+  * New upstream update.
+  * Fixed compilation error on non intel or m68k (sigaction structure).
+  * Fixed license file.
+
+ -- Jean-Francois Dive <jef@linuxbe.org>  Thu, 21 Feb 2002 15:36:08 +1100
+
+l2tpd (0.64-1) unstable; urgency=low
+
+  * Initial Debianization (Closes: #127683).
+
+ -- Jean-Francois Dive <jef@linuxbe.org>  Thu, 21 Feb 2002 15:36:08 +1100
+
--- l2tpd-0.67.orig/debian/control
+++ l2tpd-0.67/debian/control
@@ -0,0 +1,18 @@
+Source: l2tpd
+Maintainer: Jean-Francois Dive <jef@debian.org>
+Priority: optional
+Section: net
+Standards-Version: 3.5.6
+Build-Depends: debhelper (>= 3.0.5)
+
+Package: l2tpd
+Priority: optional
+Section: net
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: A layer 2 tunneling client/server program.
+ l2tpd is the open source implementation of the l2tp tunneling
+ protocol (rfc2661). 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. 
+
--- l2tpd-0.67.orig/debian/copyright
+++ l2tpd-0.67/debian/copyright
@@ -0,0 +1,8 @@
+This package have been packaged by Jean-Francois Dive <jef@linuxbe.org>
+as l2tpd.
+
+The upstream source is the open source implementation of l2tpd which can be found
+at www.l2tpd.org. This source is a branch from the orginal work of Mark Spencer
+(www.marko.net)
+
+The l2tpd license is the GPL version 2.
--- l2tpd-0.67.orig/debian/l2tpd.dirs
+++ l2tpd-0.67/debian/l2tpd.dirs
@@ -0,0 +1,2 @@
+usr/sbin/
+etc/l2tp/
--- l2tpd-0.67.orig/debian/l2tpd.init
+++ l2tpd-0.67/debian/l2tpd.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+DAEMON=/usr/sbin/l2tpd
+PIDFILE=/var/run/l2tpd.pid
+
+test -f $DAEMON || exit 0
+
+case "$1" in
+  start)
+    start-stop-daemon --start --verbose --pidfile $PIDFILE --exec $DAEMON 
+    ;;
+  stop)
+    start-stop-daemon --stop --verbose --pidfile $PIDFILE --exec $DAEMON
+    ;;
+  restart|force-reload)
+    start-stop-daemon --stop --verbose --pidfile $PIDFILE --exec $DAEMON 
+    sleep 1
+    start-stop-daemon --start --verbose --pidfile $PIDFILE --exec $DAEMON
+    ;;
+  *)
+    echo "Usage: /etc/init.d/l2tdp {start|stop|restart|force-reload}"
+    exit 1
+    ;;
+esac
+
+exit 0
--- l2tpd-0.67.orig/debian/rules
+++ l2tpd-0.67/debian/rules
@@ -0,0 +1,68 @@
+#!/usr/bin/make -f
+
+export DH_COMPAT := 3
+
+b := $(CURDIR)/debian/l2tpd
+
+arrange: arrange-stamp
+arrange-stamp: install
+	dh_testdir
+	touch arrange-stamp
+
+binary: binary-stamp
+binary-stamp: binary-indep binary-arch
+	dh_testdir
+	touch binary-stamp
+
+binary-arch: binary-arch-stamp
+binary-arch-stamp: arrange
+	dh_testdir
+	dh_testroot
+	dh_installdocs BUGS CREDITS README TODO doc/origREADME doc/rfc2661.txt
+	dh_installman l2tpd.8 
+	dh_installinit
+	dh_installchangelogs CHANGELOG
+	dh_compress
+	dh_fixperms
+	chmod 600 $(b)/etc/l2tp/l2tp-secrets
+	dh_strip
+	dh_installdeb
+	dh_perl
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+	touch binary-arch-stamp
+
+binary-indep: binary-indep-stamp
+binary-indep-stamp: arrange
+	dh_testdir
+	touch binary-indep-stamp
+
+build: build-stamp
+build-stamp: config
+	dh_testdir
+	$(MAKE)
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	$(MAKE) clean
+	dh_clean arrange-stamp binary-stamp binary-arch-stamp binary-indep-stamp build-stamp config-stamp install-stamp 
+
+config: config-stamp
+config-stamp:
+	dh_testdir
+	touch config-stamp
+
+install: install-stamp
+install-stamp: build
+	dh_testdir
+	dh_installdirs
+	install -m 0755 l2tpd $(CURDIR)/debian/l2tpd/usr/sbin/
+	cp $(CURDIR)/doc/l2tpd.conf.sample $(CURDIR)/debian/l2tpd/etc/l2tp/l2tpd.conf
+	cp $(CURDIR)/doc/l2tp-secrets.sample $(CURDIR)/debian/l2tpd/etc/l2tp/l2tp-secrets
+	touch install-stamp
+
+.PHONY: arrange binary binary-arch binary-indep build clean config install
