From 3c54a513b0c0a3acac60e03403ab4abfa0688c62 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sat, 24 Jun 2000 12:35:42 +0000 Subject: [PATCH] If we have "indirectdata" flag set, we only send data to our uplink. --- src/net.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/net.c b/src/net.c index 62cdb144..94a66513 100644 --- a/src/net.c +++ b/src/net.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: net.c,v 1.35.4.1 2000/06/23 19:27:02 guus Exp $ + $Id: net.c,v 1.35.4.2 2000/06/24 12:35:42 guus Exp $ */ #include "config.h" @@ -291,7 +291,22 @@ cp } } - /* If indirectdata flag is set, then real_ip is actually the vpn_ip of the gateway tincd + /* If we ourselves have indirectdata flag set, we should send only to our uplink! */ + + if(myself->flags & EXPORTINDIRECTDATA) + { + for(cl = conn_list; cl != NULL && !cl->status.outgoing; cl = cl->next); + if(!cl) + { /* No open outgoing connection has been found. */ + if(debug_lvl > 2) + syslog(LOG_NOTICE, _("There is no remote host I can send this packet to.")); + return -1; + } + } + else + + /* If indirectdata flag is set for the destination we just looked up, + * then real_ip is actually the vpn_ip of the gateway tincd * it is behind. */ -- 2.39.5