]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_flowspec_vty.c
bgpd: fix crash when trying to remove non-existing rpki cache
[mirror_frr.git] / bgpd / bgp_flowspec_vty.c
index f8c06132084eb8b465387d0de98da3aabeff3f26..31d2c540fa524e2d044a299daad914ea6457cfef 100644 (file)
@@ -335,7 +335,7 @@ void route_vty_out_flowspec(struct vty *vty, struct prefix *p,
                        struct listnode *node;
                        struct bgp_pbr_match_entry *bpme;
                        struct bgp_pbr_match *bpm;
-                       int unit = 0;
+                       bool list_began = false;
                        struct list *list_bpm;
 
                        list_bpm = list_new();
@@ -347,14 +347,14 @@ void route_vty_out_flowspec(struct vty *vty, struct prefix *p,
                                if (listnode_lookup(list_bpm, bpm))
                                        continue;
                                listnode_add(list_bpm, bpm);
-                               if (unit == 0)
+                               if (!list_began) {
                                        vty_out(vty, " (");
-                               else
+                                       list_began = true;
+                               } else
                                        vty_out(vty, ", ");
                                vty_out(vty, "%s", bpm->ipset_name);
-                               unit++;
                        }
-                       if (unit)
+                       if (list_began)
                                vty_out(vty, ")");
                        vty_out(vty, "\n");
                        list_delete_and_null(&list_bpm);