]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospf6d: minor code enhancements.
authorManoj Naragund <mnaragund@vmware.com>
Fri, 22 Oct 2021 07:33:10 +0000 (00:33 -0700)
committerManoj Naragund <mnaragund@vmware.com>
Tue, 26 Oct 2021 07:57:03 +0000 (00:57 -0700)
Description:
code changes involve removal of increment and decrement operators
during function calls. These expressions make code less readable.

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
ospf6d/ospf6_asbr.c
ospf6d/ospf6_nssa.c

index cd2791fc48ccc1b71bb3527b85f73d423e83d08c..fafe3dc36de8b1b159308c8fb94e040fa1307333 100644 (file)
@@ -1308,7 +1308,8 @@ static void ospf6_asbr_redistribute_set(struct ospf6 *ospf6, int type)
 {
        ospf6_zebra_redistribute(type, ospf6->vrf_id);
 
-       ospf6_asbr_status_update(ospf6, ++ospf6->redist_count);
+       ++ospf6->redist_count;
+       ospf6_asbr_status_update(ospf6, ospf6->redist_count);
 }
 
 static void ospf6_asbr_redistribute_unset(struct ospf6 *ospf6,
@@ -1330,7 +1331,8 @@ static void ospf6_asbr_redistribute_unset(struct ospf6 *ospf6,
        }
 
        ospf6_asbr_routemap_unset(red);
-       ospf6_asbr_status_update(ospf6, --ospf6->redist_count);
+       --ospf6->redist_count;
+       ospf6_asbr_status_update(ospf6, ospf6->redist_count);
 }
 
 /* When an area is unstubified, flood all the external LSAs in the area */
index c2e9b7f28af3906aad612374e95413fe89a8b0ad..c12964ea2f21dccb298806d0f25d27577278a55a 100644 (file)
@@ -185,12 +185,15 @@ void ospf6_abr_nssa_check_status(struct ospf6 *ospf6)
                 * when they are not translating.
                 */
                if (old_state != area->NSSATranslatorState) {
-                       if (old_state == OSPF6_NSSA_TRANSLATE_DISABLED)
+                       if (old_state == OSPF6_NSSA_TRANSLATE_DISABLED) {
+                               ++ospf6->redist_count;
                                ospf6_asbr_status_update(ospf6,
-                                                        ++ospf6->redist_count);
-                       else
+                                                        ospf6->redist_count);
+                       } else {
+                               --ospf6->redist_count;
                                ospf6_asbr_status_update(ospf6,
-                                                        --ospf6->redist_count);
+                                                        ospf6->redist_count);
+                       }
                }
        }
 }