]> git.meshlink.io Git - meshlink/commitdiff
Added new config variable "ProxyMode". If enabled, all outgoing packets
authorGuus Sliepen <guus@tinc-vpn.org>
Mon, 8 May 2000 18:44:15 +0000 (18:44 +0000)
committerGuus Sliepen <guus@tinc-vpn.org>
Mon, 8 May 2000 18:44:15 +0000 (18:44 +0000)
are sent to the uplink (ConnectTo), which will have to forward them for
us (kernel should do that). This is for people behind firewalls.

src/conf.c
src/conf.h
src/net.c

index 6f949f560c1d8be6c1d3183e509761be2efe7260..90ad58fc09cedf7de0df586de1b7f0a07a080962 100644 (file)
@@ -59,6 +59,7 @@ static internal_config_t hazahaza[] = {
   { "PingTimeout",  pingtimeout,    TYPE_INT },
   { "TapDevice",    tapdevice,      TYPE_NAME },
   { "KeyExpire",    keyexpire,      TYPE_INT },
+  { "ProxyMode",    proxymode,      TYPE_BOOL },
   { NULL, 0, 0 }
 };
 
index 2d83092df38c352c6132311d3e2f4aea15412900..673573b3d62f6fc34450af2fe7fac4b44a24b145 100644 (file)
@@ -41,6 +41,7 @@ typedef enum which_t {
   allowconnect,
   pingtimeout,
   keyexpire,
+  proxymode
 } which_t;
 
 typedef struct config_t {
index 7b9133e0c02d005761300fa24a4bcf03fa8ae1b6..58f3e02fbedba61472c062e890b7f9d9f262d1c8 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -258,8 +258,14 @@ cp
 */
 int send_packet(ip_t to, vpn_packet_t *packet)
 {
+  config_t const *cfg;
   conn_list_t *cl;
 cp
+  if(!(cfg = get_config_val(proxymode)))               /* In case we are in proxy mode, just send everything to our uplink. */
+    cl = conn_list;
+  else
+    cl = lookup_conn(to);
+
   if((cl = lookup_conn(to)) == NULL)
     {
       if(debug_lvl > 2)