From d0ba34ccae02d07051bc3f7012a6c116cfb3b653 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 8 May 2000 18:44:15 +0000 Subject: [PATCH] Added new config variable "ProxyMode". If enabled, all outgoing packets 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 | 1 + src/conf.h | 1 + src/net.c | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/src/conf.c b/src/conf.c index 6f949f56..90ad58fc 100644 --- a/src/conf.c +++ b/src/conf.c @@ -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 } }; diff --git a/src/conf.h b/src/conf.h index 2d83092d..673573b3 100644 --- a/src/conf.h +++ b/src/conf.h @@ -41,6 +41,7 @@ typedef enum which_t { allowconnect, pingtimeout, keyexpire, + proxymode } which_t; typedef struct config_t { diff --git a/src/net.c b/src/net.c index 7b9133e0..58f3e02f 100644 --- 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) -- 2.39.5