summaryrefslogtreecommitdiff
path: root/net/l2tpd/files/patch-file.c
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2003-04-16 13:53:27 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2003-04-16 13:53:27 +0000
commit5b063c85811b32dcea3c665c7a32d68f2eac04e4 (patch)
treebd443f96bdb55506cff2332ff11444080a32f796 /net/l2tpd/files/patch-file.c
parentLet pppd(8) control the IP address allocation. (diff)
When l2tpd(8) runs on a multi-homed machine, and you attempt to
establish an L2TP VPN connection to its external IP address from the Windows XP box on your LAN, l2tpd(8) will reply (UDP) from its local IP address, and not external IP address. Implement the new global option "address" to aid in overcoming this problem. Also helps in environments with complex NAT configurations. Bump PORTREVISION. Approved by: sobomax
Notes
Notes: svn path=/head/; revision=79082
Diffstat (limited to 'net/l2tpd/files/patch-file.c')
-rw-r--r--net/l2tpd/files/patch-file.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/net/l2tpd/files/patch-file.c b/net/l2tpd/files/patch-file.c
index d76f4381b637..912697df2f04 100644
--- a/net/l2tpd/files/patch-file.c
+++ b/net/l2tpd/files/patch-file.c
@@ -2,7 +2,7 @@
$FreeBSD$
--- file.c.orig Sat Aug 10 03:55:14 2002
-+++ file.c Wed Oct 23 16:33:17 2002
++++ file.c Wed Apr 16 16:07:19 2003
@@ -18,10 +18,7 @@
#include <unistd.h>
#include <stdlib.h>
@@ -14,3 +14,41 @@ $FreeBSD$
#include "l2tp.h"
+@@ -207,6 +204,29 @@
+ return 0;
+ }
+
++int set_address (char *word, char *value, int context, void *item)
++{
++ switch (context & ~CONTEXT_DEFAULT)
++ {
++ case CONTEXT_GLOBAL:
++#ifdef DEBUG_FILE
++ log (LOG_DEBUG, "set_address: Setting global IP address to %s\n",
++ value);
++#endif
++ if (!inet_aton(value, &(((struct global *) item)->addr)))
++ {
++ snprintf (filerr, sizeof (filerr), "invalid address given\n");
++ return -1;
++ }
++ break;
++ default:
++ snprintf (filerr, sizeof (filerr), "'%s' not valid in this context\n",
++ word);
++ return -1;
++ }
++ return 0;
++}
++
+ int set_port (char *word, char *value, int context, void *item)
+ {
+ switch (context & ~CONTEXT_DEFAULT)
+@@ -1196,6 +1216,7 @@
+ }
+
+ struct keyword words[] = {
++ {"address", &set_address},
+ {"port", &set_port},
+ {"rand source", &set_rand_source},
+ {"auth file", &set_authfile},