]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/command.c
*: list_delete_and_null() -> list_delete()
[mirror_frr.git] / lib / command.c
index 1df644210723a3e7ec47ad382bf79940d08c5d82..60c5f4e75b1d1a223635c7e24c6c0d0fbd2cc1c6 100644 (file)
@@ -146,6 +146,7 @@ const char *node_names[] = {
                                     */
        "bfd",                   /* BFD_NODE */
        "bfd peer",              /* BFD_PEER_NODE */
+       "openfabric",               // OPENFABRIC_NODE
 };
 /* clang-format on */
 
@@ -617,8 +618,8 @@ static int cmd_try_do_shortcut(enum node_type node, char *first_word)
  */
 static int compare_completions(const void *fst, const void *snd)
 {
-       struct cmd_token *first = *(struct cmd_token **)fst,
-                        *secnd = *(struct cmd_token **)snd;
+       const struct cmd_token *first = *(const struct cmd_token * const *)fst,
+                              *secnd = *(const struct cmd_token * const *)snd;
        return strcmp(first->text, secnd->text);
 }
 
@@ -694,7 +695,7 @@ static vector cmd_complete_command_real(vector vline, struct vty *vty,
        }
 
        vector comps = completions_to_vec(completions);
-       list_delete_and_null(&completions);
+       list_delete(&completions);
 
        // set status code appropriately
        switch (vector_active(comps)) {
@@ -1019,7 +1020,7 @@ static int cmd_execute_command_real(vector vline, enum filter_type filter,
        // if matcher error, return corresponding CMD_ERR
        if (MATCHER_ERROR(status)) {
                if (argv_list)
-                       list_delete_and_null(&argv_list);
+                       list_delete(&argv_list);
                switch (status) {
                case MATCHER_INCOMPLETE:
                        return CMD_ERR_INCOMPLETE;
@@ -1048,7 +1049,7 @@ static int cmd_execute_command_real(vector vline, enum filter_type filter,
                ret = matched_element->func(matched_element, vty, argc, argv);
 
        // delete list and cmd_token's in it
-       list_delete_and_null(&argv_list);
+       list_delete(&argv_list);
        XFREE(MTYPE_TMP, argv);
 
        return ret;
@@ -1197,6 +1198,7 @@ static int handle_pipe_action(struct vty *vty, const char *cmd_in,
 
        /* retrieve action */
        token = strsep(&working, " ");
+       assert(token);
 
        /* match result to known actions */
        if (strmatch(token, "include")) {
@@ -1435,6 +1437,7 @@ void cmd_exit(struct vty *vty)
        case LDP_NODE:
        case LDP_L2VPN_NODE:
        case ISIS_NODE:
+       case OPENFABRIC_NODE:
        case KEYCHAIN_NODE:
        case RMAP_NODE:
        case PBRMAP_NODE:
@@ -1550,6 +1553,7 @@ DEFUN (config_end,
        case LDP_L2VPN_NODE:
        case LDP_PSEUDOWIRE_NODE:
        case ISIS_NODE:
+       case OPENFABRIC_NODE:
        case KEYCHAIN_NODE:
        case KEYCHAIN_KEY_NODE:
        case VTY_NODE:
@@ -2417,7 +2421,7 @@ static int set_log_file(struct vty *vty, const char *fname, int loglevel)
                cwd[MAXPATHLEN] = '\0';
 
                if (getcwd(cwd, MAXPATHLEN) == NULL) {
-                       flog_err_sys(LIB_ERR_SYSTEM_CALL,
+                       flog_err_sys(EC_LIB_SYSTEM_CALL,
                                     "config_log_file: Unable to alloc mem!");
                        return CMD_WARNING_CONFIG_FAILED;
                }
@@ -2945,6 +2949,6 @@ void cmd_terminate()
        if (host.config)
                XFREE(MTYPE_HOST, host.config);
 
-       list_delete_and_null(&varhandlers);
+       list_delete(&varhandlers);
        qobj_finish();
 }