- buflen = snprintf(buffer, MAXBUFSIZE, "%d %lx %lx/%lx:%x\n", ADD_HOST, new_host->real_ip, new_host->vpn_ip, new_host->vpn_mask, new_host->port);
+ real_ip = new_host->real_ip;
+ flags = new_host->flags;
+
+ /* If we need to propagate information about a new host that wants us to export
+ * it's indirectdata flag, we set the INDIRECTDATA flag and unset the EXPORT...
+ * flag, and set it's real_ip to our vpn_ip, so that net.c send_packet() will
+ * work correctly.
+ */
+
+ if(flags & EXPORTINDIRECTDATA)
+ {
+ flags &= ~EXPORTINDIRECTDATA;
+ flags |= INDIRECTDATA;
+ real_ip = myself->vpn_ip;
+ }
+
+ buflen = snprintf(buffer, MAXBUFSIZE, "%d %lx %lx/%lx:%x %d\n", ADD_HOST, new_host->real_ip, new_host->vpn_ip, new_host->vpn_mask, new_host->port, flags);