]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: fix the dead code 15861/head
authoranlan_cs <anlan_cs@tom.com>
Sat, 27 Apr 2024 12:59:05 +0000 (20:59 +0800)
committeranlan_cs <anlan_cs@tom.com>
Sat, 27 Apr 2024 16:05:36 +0000 (00:05 +0800)
Fixed the Coverity issue 1586018:
Control flow issues (DEADCODE) /bgpd/bgp_ecommunity.c: 1402 in ecommunity_ecom2str()

Signed-off-by: anlan_cs <anlan_cs@tom.com>
bgpd/bgp_ecommunity.c

index be8f56637e9a36e32c76ab1e618aa89dc7cd9959..d392b6585c953aff44166c2a64858ea868d36e84 100644 (file)
@@ -1396,11 +1396,7 @@ char *ecommunity_ecom2str(struct ecommunity *ecom, int format, int filter)
                        if (sub_type == ECOMMUNITY_LINK_BANDWIDTH)
                                ecommunity_lb_str(encbuf, sizeof(encbuf), pnt,
                                                  ecom->disable_ieee_floating);
-                       else
-                               unk_ecom = 1;
-               } else if (type == ECOMMUNITY_ENCODE_AS_NON_TRANS) {
-                       sub_type = *pnt++;
-                       if (sub_type == ECOMMUNITY_EXTENDED_LINK_BANDWIDTH)
+                       else if (sub_type == ECOMMUNITY_EXTENDED_LINK_BANDWIDTH)
                                ipv6_ecommunity_lb_str(encbuf, sizeof(encbuf),
                                                       pnt);
                        else