Enable/disable inactive/active segments only
This commit is contained in:
committed by
Martin Willi
parent
310498f3de
commit
9fdf5f712e
@@ -127,13 +127,19 @@ static void enable_disable(private_ha_sync_segments_t *this, u_int segment,
|
|||||||
{
|
{
|
||||||
if (enable)
|
if (enable)
|
||||||
{
|
{
|
||||||
this->active |= SEGMENTS_BIT(i);
|
if (!(this->active & SEGMENTS_BIT(i)))
|
||||||
this->kernel->activate(this->kernel, i);
|
{
|
||||||
|
this->active |= SEGMENTS_BIT(i);
|
||||||
|
this->kernel->activate(this->kernel, i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->active &= ~SEGMENTS_BIT(i);
|
if (this->active & SEGMENTS_BIT(i))
|
||||||
this->kernel->deactivate(this->kernel, i);
|
{
|
||||||
|
this->active &= ~SEGMENTS_BIT(i);
|
||||||
|
this->kernel->deactivate(this->kernel, i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user