- if (new_state == VRRP_VR_STATE_MASTER)
- {
- intf->n_master_vrs[is_ipv6]++;
- if (intf->n_master_vrs[is_ipv6] == 1)
- vnet_feature_enable_disable (arc_name, node_name,
- vr->config.sw_if_index, 1, NULL, 0);
- }
- else
+
+ /* Check other VRs on this intf to see if features need to be toggled */
+ vec_foreach (vr_index, intf->vr_indices[is_ipv6])
+ {
+ vrrp_vr_t *intf_vr = vrrp_vr_lookup_index (*vr_index);
+
+ if (intf_vr == vr)
+ continue;
+
+ if (intf_vr->runtime.state == VRRP_VR_STATE_INIT)
+ continue;
+
+ n_started++;
+
+ if ((intf_vr->runtime.state == VRRP_VR_STATE_MASTER) &&
+ vrrp_vr_accept_mode_enabled (intf_vr))
+ n_master_accept++;
+ }
+
+ /* If entering/leaving init state, start/stop ARP or ND feature if no other
+ * VRs are active on the interface.
+ */
+ if (((vr->runtime.state == VRRP_VR_STATE_INIT) ||
+ (new_state == VRRP_VR_STATE_INIT)) && (n_started == 0))
+ vnet_feature_enable_disable (arc_name, node_name,
+ vr->config.sw_if_index,
+ (new_state != VRRP_VR_STATE_INIT), NULL, 0);
+
+ /* Special housekeeping when entering/leaving master mode */
+ if ((vr->runtime.state == VRRP_VR_STATE_MASTER) ||
+ (new_state == VRRP_VR_STATE_MASTER))