]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: simplify one check for evpn-mh
authoranlan_cs <vic.lan@pica8.com>
Fri, 8 Apr 2022 01:04:51 +0000 (21:04 -0400)
committeranlan_cs <vic.lan@pica8.com>
Tue, 12 Apr 2022 05:26:54 +0000 (01:26 -0400)
An simplification for one check in
`zebra_evpn_mh_uplink_oper_flags_update()`.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
zebra/zebra_evpn_mh.c

index 02eda4a438a656d98a4a7637b842e11dd38b6687..a4272dd82e6f5a220de3ef8769b5b6c67facd9be 100644 (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,
                                                   bool set)
 {
-       if (set) {
-               if (if_is_operative(zif->ifp)) {
-                       if (!(zif->flags & ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP)) {
-                               zif->flags |= ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP;
-                               ++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;
-                       }
+       if (set && if_is_operative(zif->ifp)) {
+               if (!(zif->flags & ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP)) {
+                       zif->flags |= ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP;
+                       ++zmh_info->uplink_oper_up_cnt;
                }
        } else {
                if (zif->flags & ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP) {