]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd zebra: dead code (Clang scan) 2587/head
authorF. Aragon <paco@voltanet.io>
Fri, 29 Jun 2018 15:01:29 +0000 (17:01 +0200)
committerF. Aragon <paco@voltanet.io>
Fri, 29 Jun 2018 15:47:05 +0000 (17:47 +0200)
This correction fixes two bugs detected by Clang scan:

Bug Group: Dead store

Bug Type: Dead assignment
File: zebra/kernel_netlink.c
Function: netlink_parse_extended_ack
Line: 548

Bug Type: Dead increment
File: isisd/isis_lsp.c
Function: lsp_bits2string
Line: 625

Signed-off-by: F. Aragon <paco@voltanet.io>
isisd/isis_lsp.c
zebra/kernel_netlink.c

index bba86d4c1ff07b4375860fe3943d6927835e6a97..67e6bac8d7da334d735d53a8f89e5956dd0196c9 100644 (file)
@@ -622,7 +622,7 @@ static const char *lsp_bits2string(uint8_t lsp_bits, char *buf, size_t buf_size)
        pos += sprintf(pos, "%d/",
                       ISIS_MASK_LSP_PARTITION_BIT(lsp_bits) ? 1 : 0);
 
-       pos += sprintf(pos, "%d", ISIS_MASK_LSP_OL_BIT(lsp_bits) ? 1 : 0);
+       sprintf(pos, "%d", ISIS_MASK_LSP_OL_BIT(lsp_bits) ? 1 : 0);
 
        return buf;
 }
index 7334c8094a3001c0bf4ccde57cb0ff43842c3b14..d9c663184531acb27f873f4ac1664bed917ceb93 100644 (file)
@@ -545,7 +545,6 @@ static void netlink_parse_extended_ack(struct nlmsghdr *h)
 
                if (off > h->nlmsg_len) {
                        zlog_err("Invalid offset for NLMSGERR_ATTR_OFFS\n");
-                       off = 0;
                } else if (!(h->nlmsg_flags & NLM_F_CAPPED)) {
                        /*
                         * Header of failed message