]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd,ospf6d: make clear the comparison of routemap name 10313/head
authoranlan_cs <anlan_cs@tom.com>
Tue, 11 Jan 2022 01:45:10 +0000 (20:45 -0500)
committeranlan_cs <anlan_cs@tom.com>
Tue, 11 Jan 2022 04:24:24 +0000 (23:24 -0500)
Comparison of the two pointer is confusing, they have no relevance
except the time both of them are empty.

Additionly modify one variable name and correct some comment words, they
are same in both ospfd and ospf6d.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
ospf6d/ospf6_asbr.c
ospfd/ospf_vty.c

index 99f30a4a06a718c067e0fcb37f2904a333a68fa7..5cb6244bbc8ef08d7c810f8e530d985d85e128d4 100644 (file)
@@ -1936,13 +1936,13 @@ DEFPY (ospf6_default_route_originate,
        if (mtype_str == NULL)
                mtype = -1;
 
-       /* To check ,if user is providing same route map */
-       if ((rtmap == ROUTEMAP_NAME(red))
-           || (rtmap && ROUTEMAP_NAME(red)
-               && (strcmp(rtmap, ROUTEMAP_NAME(red)) == 0)))
+       /* To check if user is providing same route map */
+       if ((!rtmap && !ROUTEMAP_NAME(red)) ||
+           (rtmap && ROUTEMAP_NAME(red) &&
+            (strcmp(rtmap, ROUTEMAP_NAME(red)) == 0)))
                sameRtmap = true;
 
-       /* Don't allow if the same lsa is aleardy originated. */
+       /* Don't allow if the same lsa is already originated. */
        if ((sameRtmap) && (red->dmetric.type == mtype)
            && (red->dmetric.value == mval)
            && (cur_originate == default_originate))
index 8cab6b9897125764f9d6190bc876043ff227c32f..2df6103a6f054d522bfda9f1b0591467c5c3814b 100644 (file)
@@ -9275,7 +9275,7 @@ DEFUN (ospf_default_information_originate,
        struct ospf_redist *red;
        int idx = 0;
        int cur_originate = ospf->default_originate;
-       int sameRtmap = 0;
+       bool sameRtmap = false;
        char *rtmap = NULL;
 
        red = ospf_redist_add(ospf, DEFAULT_ROUTE, 0);
@@ -9300,13 +9300,13 @@ DEFUN (ospf_default_information_originate,
        if (argv_find(argv, argc, "WORD", &idx))
                rtmap = argv[idx]->arg;
 
-       /* To check ,if user is providing same route map */
-       if ((rtmap == ROUTEMAP_NAME(red)) ||
-           (rtmap && ROUTEMAP_NAME(red)
-           && (strcmp(rtmap, ROUTEMAP_NAME(red)) == 0)))
-               sameRtmap = 1;
+       /* To check if user is providing same route map */
+       if ((!rtmap && !ROUTEMAP_NAME(red)) ||
+           (rtmap && ROUTEMAP_NAME(red) &&
+            (strcmp(rtmap, ROUTEMAP_NAME(red)) == 0)))
+               sameRtmap = true;
 
-       /* Don't allow if the same lsa is aleardy originated. */
+       /* Don't allow if the same lsa is already originated. */
        if ((sameRtmap)
            && (red->dmetric.type == type)
            && (red->dmetric.value == metric)