dhcp: search for transactions only for connections having a poolname "dhcp"
authorMartin Willi <martin@revosec.ch>
Tue, 18 Jun 2013 07:50:29 +0000 (09:50 +0200)
committerMartin Willi <martin@revosec.ch>
Tue, 18 Jun 2013 07:50:29 +0000 (09:50 +0200)
When a connection has a single pool that queries recursively the DHCP backend,
we shouldn't return any attributes directly from DHCP when queried for that
pool.

src/libcharon/plugins/dhcp/dhcp_provider.c

index f83efda..e092771 100644 (file)
@@ -162,6 +162,12 @@ METHOD(attribute_provider_t, create_attribute_enumerator, enumerator_t*,
        enumerator_t *enumerator;
        host_t *vip;
 
+       if (pools->find_first(pools, (linked_list_match_t)streq,
+                                                 NULL, "dhcp") != SUCCESS)
+       {
+               return NULL;
+       }
+
        this->mutex->lock(this->mutex);
        enumerator = vips->create_enumerator(vips);
        while (enumerator->enumerate(enumerator, &vip))
@@ -225,4 +231,3 @@ dhcp_provider_t *dhcp_provider_create(dhcp_socket_t *socket)
 
        return &this->public;
 }
-