- ifdebug(PROTOCOL) logger(LOG_WARNING, _("Got %s from %s (%s) for ourself"),
- "ADD_SUBNET", c->name, c->hostname);
- s->owner = myself;
- send_del_subnet(c, s);
+ logger(DEBUG_PROTOCOL, LOG_WARNING, "Got %s from %s (%s) for ourself",
+ "ADD_SUBNET", c->name, c->hostname);
+ s.owner = myself;
+ send_del_subnet(c, &s);
+ return true;
+ }
+
+ /* In tunnel server mode, we should already know all allowed subnets */
+
+ if(tunnelserver) {
+ logger(DEBUG_ALWAYS, LOG_WARNING, "Ignoring unauthorized %s from %s (%s): %s",
+ "ADD_SUBNET", c->name, c->hostname, subnetstr);
+ return true;
+ }
+
+ /* Ignore if strictsubnets is true, but forward it to others */
+
+ if(strictsubnets) {
+ logger(DEBUG_ALWAYS, LOG_WARNING, "Ignoring unauthorized %s from %s (%s): %s",
+ "ADD_SUBNET", c->name, c->hostname, subnetstr);
+ forward_request(c, request);