ha: Divide virtual IPs evenly among all segments
authorTobias Brunner <tobias@strongswan.org>
Tue, 20 Nov 2018 15:40:21 +0000 (16:40 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 7 Dec 2018 09:15:40 +0000 (10:15 +0100)
src/libcharon/plugins/ha/ha_attribute.c

index 224e223..2553fd0 100644 (file)
@@ -165,7 +165,7 @@ static bool responsible_for(private_ha_attribute_t *this, int offset)
 {
        u_int segment;
 
-       segment = this->kernel->get_segment_int(this->kernel, offset);
+       segment = offset % this->segments->count(this->segments) + 1;
        return this->segments->is_active(this->segments, segment);
 }