X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprotocol.c;h=e9bad82e7e5c6830bb27f3a043f9e14e23972a8f;hp=0385c9c0c8bb1aa6f61e6c00b1ae94a92abad633;hb=17fa07510ad74d0f96f9700538d32eb8e7b2a0ce;hpb=e7f22d2f5f0a5fcd52da7512ab734b0ba52c623f;ds=sidebyside diff --git a/src/protocol.c b/src/protocol.c index 0385c9c0..e9bad82e 100644 --- a/src/protocol.c +++ b/src/protocol.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: protocol.c,v 1.27 2000/05/29 23:40:05 guus Exp $ + $Id: protocol.c,v 1.28 2000/05/30 21:36:16 zarq Exp $ */ #include "config.h" @@ -570,7 +570,8 @@ int add_host_h(conn_list_t *cl) unsigned short port; conn_list_t *ncn, *fw; cp - if(!cl->status.active) return -1; + if(!cl->status.active) + return -1; if(sscanf(cl->buffer, "%*d %lx %lx/%lx:%hx", &real_ip, &vpn_ip, &vpn_mask, &port) != 4) { syslog(LOG_ERR, _("got bad ADD_HOST request: %s"), cl->buffer); @@ -588,7 +589,12 @@ cp */ if((fw = lookup_conn(vpn_ip))) { - notify_others(fw, cl, send_add_host); + if(fw->nexthop == cl) + notify_others(fw, cl, send_add_host); + else + if(debug_lvl > 1) + syslog(LOG_DEBUG, _("Invalid add_host request from " IP_ADDR_S), + IP_ADDR_V(cl->vpn_ip)); return 0; }