Commit 9e453fb4 authored by Bernhard Reutner-Fischer's avatar Bernhard Reutner-Fischer
Browse files

- add a layer 2 tunneling protocol package

parent f0be91fd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -130,6 +130,7 @@ source "package/hostap/Config.in"
source "package/iproute2/Config.in"
source "package/ipsec-tools/Config.in"
source "package/iptables/Config.in"
source "package/l2tp/Config.in"
source "package/libcgi/Config.in"
source "package/libcgicc/Config.in"
source "package/libpcap/Config.in"

package/l2tp/Config.in

0 → 100644
+8 −0
Original line number Diff line number Diff line
config BR2_PACKAGE_L2TP
	bool "l2tp"
	default n
	help
	  Layer 2 Tunnelling Protocol (RFC2661).

	  http://sourceforge.net/projects/l2tpd/
+14 −0
Original line number Diff line number Diff line
--- l2tpd-0.70-pre20031121.oorig/osport.h	2004-07-08 22:47:52.000000000 +0200
+++ l2tpd-0.70-pre20031121/osport.h	2006-12-28 15:32:50.000000000 +0100
@@ -37,4 +37,11 @@
 
 #endif /* defined(SOLARIS) */
 
+#if defined __UCLIBC__ && !defined UCLIBC_SUSV3_LEGACY_MACROS
+# define index(x, y)        strchr(x, y)
+# define bcopy(S1, S2, LEN) ((void)memmove(S2, S1, LEN))
+# define bzero(S1, LEN)     ((void)memset(S1,  0, LEN))
+# define bcmp(S1,S2,LEN)    ((memcmp(S2, S1, LEN)==0)?0:1)
+#endif /* defined __UCLIBC__ && !defined UCLIBC_SUSV3_LEGACY_MACROS */
+
 #endif /* _OSPORT_H_ */
+33 −0
Original line number Diff line number Diff line
--- l2tpd-0.70-pre20031121.oorig/avpsend.c	2006-12-28 16:00:26.000000000 +0100
+++ l2tpd-0.70-pre20031121/avpsend.c	2006-12-28 16:21:06.000000000 +0100
@@ -98,19 +98,26 @@ int add_hostname_avp(struct buffer *buf,
 	int sz = 0;
 	if(t->lac && t->lac->hostname[0]) {
 		strncpy(n,t->lac->hostname, sizeof(n));
-		sz = strnlen(t->lac->hostname, sizeof(t->lac->hostname));
+		sz = strlen(t->lac->hostname);
+		if (sz > sizeof(t->lac->hostname))
+			sz = sizeof(t->lac->hostname);
 	}
 	else if(t->lns && t->lns->hostname[0]) {
 		strncpy(n,t->lns->hostname, sizeof(n));
-		sz = strnlen(t->lns->hostname, sizeof(t->lns->hostname));
+		sz = strlen(t->lns->hostname);
+		if (sz > sizeof(t->lns->hostname))
+			sz = sizeof(t->lns->hostname);
 	}
 	else {
 		if(gethostname(n, STRLEN)) {
 			strcpy(n,"eriwan");
 			sz = 6;
 		}
-		else
-			sz = strnlen(n, sizeof(n));
+		else {
+			sz = strlen(n);
+			if (sz > sizeof(n))
+				sz = sizeof(n);
+		}
 	}
 	if(add_avp(buf, HOSTNAME_AVP, n, sz, 1))
 		return 1;
+2902 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading