Check address family in HA virtual IP backend
authorMartin Willi <martin@revosec.ch>
Mon, 27 Aug 2012 14:26:01 +0000 (16:26 +0200)
committerMartin Willi <martin@revosec.ch>
Thu, 30 Aug 2012 14:43:44 +0000 (16:43 +0200)
src/libcharon/plugins/ha/ha_attribute.c

index 64bd2b8..f18c58b 100644 (file)
@@ -181,6 +181,12 @@ METHOD(attribute_provider_t, acquire_address, host_t*,
        pool = get_pool(this, name);
        if (pool)
        {
+               if (pool->base->get_family(pool->base) !=
+                       requested->get_family(requested))
+               {
+                       this->mutex->unlock(this->mutex);
+                       return NULL;
+               }
                for (byte = 0; byte < pool->size / 8; byte++)
                {
                        if (pool->mask[byte] != 0xFF)