From: Guus Sliepen Date: Mon, 8 May 2000 18:44:15 +0000 (+0000) Subject: Added new config variable "ProxyMode". If enabled, all outgoing packets X-Git-Tag: release-1.0pre1 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=d0ba34ccae02d07051bc3f7012a6c116cfb3b653;p=tinc 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. --- 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)