From: Tobias Brunner Date: Tue, 20 Nov 2018 15:40:21 +0000 (+0100) Subject: ha: Divide virtual IPs evenly among all segments X-Git-Tag: 5.7.2dr4~8^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5dbb826da5eb11f5f5d3380185b082c9e6f2fe01;p=thirdparty%2Fstrongswan.git ha: Divide virtual IPs evenly among all segments --- diff --git a/src/libcharon/plugins/ha/ha_attribute.c b/src/libcharon/plugins/ha/ha_attribute.c index 224e223621..2553fd0143 100644 --- a/src/libcharon/plugins/ha/ha_attribute.c +++ b/src/libcharon/plugins/ha/ha_attribute.c @@ -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); }