zebra: simplify one check for evpn-mh

An simplification for one check in
`zebra_evpn_mh_uplink_oper_flags_update()`.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
This commit is contained in:
anlan_cs 2022-04-07 21:04:51 -04:00
parent 4037154240
commit 9a8fc8f88d

View file

@ -3758,18 +3758,10 @@ static inline bool zebra_evpn_mh_is_all_uplinks_down(void)
static void zebra_evpn_mh_uplink_oper_flags_update(struct zebra_if *zif, static void zebra_evpn_mh_uplink_oper_flags_update(struct zebra_if *zif,
bool set) bool set)
{ {
if (set) { if (set && if_is_operative(zif->ifp)) {
if (if_is_operative(zif->ifp)) { if (!(zif->flags & ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP)) {
if (!(zif->flags & ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP)) { zif->flags |= ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP;
zif->flags |= ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP; ++zmh_info->uplink_oper_up_cnt;
++zmh_info->uplink_oper_up_cnt;
}
} else {
if (zif->flags & ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP) {
zif->flags &= ~ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP;
if (zmh_info->uplink_oper_up_cnt)
--zmh_info->uplink_oper_up_cnt;
}
} }
} else { } else {
if (zif->flags & ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP) { if (zif->flags & ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP) {