]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: fix wrong check for two commands 17779/head
authoranlan_cs <anlan_cs@126.com>
Tue, 7 Jan 2025 02:55:02 +0000 (10:55 +0800)
committeranlan_cs <anlan_cs@126.com>
Tue, 7 Jan 2025 02:58:03 +0000 (10:58 +0800)
The users would know the failure of some case for the two commands, just
return the error ```CMD_WARNING_CONFIG_FAILED```.

Signed-off-by: anlan_cs <anlan_cs@126.com>
ospfd/ospf_vty.c

index 27528f659432854b9ffdcebd1edfe9b6bc75e81c..95e8b179d8001fbe76258a2f0738f1d814898a29 100644 (file)
@@ -10258,8 +10258,10 @@ DEFUN (ospf_external_route_aggregation,
                tag = strtoul(argv[idx + 2]->arg, NULL, 10);
 
        ret = ospf_asbr_external_aggregator_set(ospf, &p, tag);
-       if (ret == OSPF_INVALID)
-               vty_out(vty, "Invalid configuration!!\n");
+       if (ret == OSPF_FAILURE) {
+               vty_out(vty, "%% Failed to set summary-address!\n");
+               return CMD_WARNING_CONFIG_FAILED;
+       }
 
        return CMD_SUCCESS;
 }
@@ -10611,8 +10613,10 @@ DEFUN (ospf_external_route_aggregation_no_adrvertise,
        }
 
        ret = ospf_asbr_external_rt_no_advertise(ospf, &p);
-       if (ret == OSPF_INVALID)
-               vty_out(vty, "Invalid configuration!!\n");
+       if (ret == OSPF_FAILURE) {
+               vty_out(vty, "%% Failed to set summary-address!\n");
+               return CMD_WARNING_CONFIG_FAILED;
+       }
 
        return CMD_SUCCESS;
 }