tunnelserver: log which ADD_SUBNET was refused
authorMichael Tokarev <mjt@tls.msk.ru>
Sun, 24 May 2009 13:23:24 +0000 (17:23 +0400)
committerGuus Sliepen <guus@tinc-vpn.org>
Mon, 25 May 2009 14:55:55 +0000 (16:55 +0200)
Add some logging about refused ADD_SUBNET
(it causes subsequent client disconnect so it's
important to know which subnet was at fault).

Maybe we should just ignore it completely.

src/protocol_subnet.c

index 3e5dadd..d40b3a3 100644 (file)
@@ -127,8 +127,11 @@ bool add_subnet_h(connection_t *c)
                        free_subnet(allowed);
                }
 
-               if(!cfg)
+               if(!cfg) {
+                       logger(LOG_WARNING, _("Unauthorized %s from %s (%s) for %s"),
+                               "ADD_SUBNET", c->name, c->hostname, subnetstr);
                        return false;
+               }
 
                free_subnet(allowed);
        }