]> git.proxmox.com Git - mirror_frr.git/blobdiff - isisd/isis_tlvs.c
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / isisd / isis_tlvs.c
index 5e73baa841564dad309d80136ad3c5133b65c97c..5a6c7bc3003718a36561f59771a09a5239482c21 100644 (file)
@@ -171,7 +171,8 @@ static int unpack_item_prefix_sid(uint16_t mtid, uint8_t len, struct stream *s,
                                  struct sbuf *log, void *dest, int indent)
 {
        struct isis_subtlvs *subtlvs = dest;
-       struct isis_prefix_sid sid = {0};
+       struct isis_prefix_sid sid = {
+       };
 
        sbuf_push(log, indent, "Unpacking SR Prefix-SID...\n");
 
@@ -2051,7 +2052,7 @@ static int unpack_tlv_purge_originator(enum isis_tlv_context context,
                                       void *dest, int indent)
 {
        struct isis_tlvs *tlvs = dest;
-       struct isis_purge_originator poi = {0};
+       struct isis_purge_originator poi = {};
 
        sbuf_push(log, indent, "Unpacking Purge Originator Identification TLV...\n");
        if (tlv_len < 7) {
@@ -3130,7 +3131,7 @@ static const struct tlv_ops *tlv_table[ISIS_CONTEXT_MAX][ISIS_TLV_MAX] = {
                [ISIS_TLV_IPV6_REACH] = &tlv_ipv6_reach_ops,
                [ISIS_TLV_MT_IPV6_REACH] = &tlv_ipv6_reach_ops,
        },
-       [ISIS_CONTEXT_SUBTLV_NE_REACH] = {0},
+       [ISIS_CONTEXT_SUBTLV_NE_REACH] = {},
        [ISIS_CONTEXT_SUBTLV_IP_REACH] = {
                [ISIS_SUBTLV_PREFIX_SID] = &tlv_prefix_sid_ops,
        },
@@ -3303,17 +3304,17 @@ static const auth_validator_func auth_validators[] = {
                [ISIS_PASSWD_TYPE_HMAC_MD5] = auth_validator_hmac_md5,
 };
 
-bool isis_tlvs_auth_is_valid(struct isis_tlvs *tlvs, struct isis_passwd *passwd,
-                            struct stream *stream, bool is_lsp)
+int isis_tlvs_auth_is_valid(struct isis_tlvs *tlvs, struct isis_passwd *passwd,
+                           struct stream *stream, bool is_lsp)
 {
        /* If no auth is set, always pass authentication */
        if (!passwd->type)
-               return true;
+               return ISIS_AUTH_OK;
 
        /* If we don't known how to validate the auth, return invalid */
        if (passwd->type >= array_size(auth_validators)
            || !auth_validators[passwd->type])
-               return false;
+               return ISIS_AUTH_NO_VALIDATOR;
 
        struct isis_auth *auth_head = (struct isis_auth *)tlvs->isis_auth.head;
        struct isis_auth *auth;
@@ -3324,10 +3325,14 @@ bool isis_tlvs_auth_is_valid(struct isis_tlvs *tlvs, struct isis_passwd *passwd,
 
        /* If matching auth TLV could not be found, return invalid */
        if (!auth)
-               return false;
+               return ISIS_AUTH_TYPE_FAILURE;
+
 
        /* Perform validation and return result */
-       return auth_validators[passwd->type](passwd, stream, auth, is_lsp);
+       if (auth_validators[passwd->type](passwd, stream, auth, is_lsp))
+               return ISIS_AUTH_OK;
+       else
+               return ISIS_AUTH_FAILURE;
 }
 
 bool isis_tlvs_area_addresses_match(struct isis_tlvs *tlvs,
@@ -3396,7 +3401,7 @@ static void tlvs_protocols_supported_to_adj(struct isis_tlvs *tlvs,
                        ipv6_supported = true;
        }
 
-       struct nlpids reduced = {0};
+       struct nlpids reduced = {};
 
        if (ipv4_supported && ipv6_supported) {
                reduced.count = 2;