]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/keychain.c
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / lib / keychain.c
index 39807cc7ce2f575181f22c93bb35a7d4a623effb..601b44a4f1abe71b2da86129fdd6e736e9f098a3 100644 (file)
@@ -119,12 +119,12 @@ static void keychain_delete(struct keychain *keychain)
        if (keychain->name)
                XFREE(MTYPE_KEYCHAIN, keychain->name);
 
-       list_delete_and_null(&keychain->key);
+       list_delete(&keychain->key);
        listnode_delete(keychain_list, keychain);
        keychain_free(keychain);
 }
 
-static struct key *key_lookup(const struct keychain *keychain, u_int32_t index)
+static struct key *key_lookup(const struct keychain *keychain, uint32_t index)
 {
        struct listnode *node;
        struct key *key;
@@ -137,7 +137,7 @@ static struct key *key_lookup(const struct keychain *keychain, u_int32_t index)
 }
 
 struct key *key_lookup_for_accept(const struct keychain *keychain,
-                                 u_int32_t index)
+                                 uint32_t index)
 {
        struct listnode *node;
        struct key *key;
@@ -172,7 +172,7 @@ struct key *key_match_for_accept(const struct keychain *keychain,
                if (key->accept.start == 0
                    || (key->accept.start <= now
                        && (key->accept.end >= now || key->accept.end == -1)))
-                       if (strncmp(key->string, auth_str, 16) == 0)
+                       if (key->string && (strncmp(key->string, auth_str, 16) == 0))
                                return key;
        }
        return NULL;
@@ -197,7 +197,7 @@ struct key *key_lookup_for_send(const struct keychain *keychain)
        return NULL;
 }
 
-static struct key *key_get(const struct keychain *keychain, u_int32_t index)
+static struct key *key_get(const struct keychain *keychain, uint32_t index)
 {
        struct key *key;
 
@@ -270,7 +270,7 @@ DEFUN_NOSH (key,
        int idx_number = 1;
        VTY_DECLVAR_CONTEXT(keychain, keychain);
        struct key *key;
-       u_int32_t index;
+       uint32_t index;
 
        index = strtoul(argv[idx_number]->arg, NULL, 10);
        key = key_get(keychain, index);
@@ -289,7 +289,7 @@ DEFUN (no_key,
        int idx_number = 2;
        VTY_DECLVAR_CONTEXT(keychain, keychain);
        struct key *key;
-       u_int32_t index;
+       uint32_t index;
 
        index = strtoul(argv[idx_number]->arg, NULL, 10);
        key = key_lookup(keychain, index);
@@ -469,7 +469,7 @@ static int key_lifetime_duration_set(struct vty *vty, struct key_range *krange,
                                     const char *duration_str)
 {
        time_t time_start;
-       u_int32_t duration;
+       uint32_t duration;
 
        time_start = key_str2time(stime_str, sday_str, smonth_str, syear_str);
        if (time_start < 0) {