]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_updgrp_adv.c
*: fix coverity warnings - error handling issues
[mirror_frr.git] / bgpd / bgp_updgrp_adv.c
index fbbeaee9b252ff24eee1d3cbb71cdf697ab2afd8..8a24cba5980394373ddf9499693f214bce315310 100644 (file)
@@ -687,11 +687,11 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw)
 
        attr.local_pref = bgp->default_local_pref;
 
-       if (afi == AFI_IP)
-               str2prefix("0.0.0.0/0", &p);
-       else if (afi == AFI_IP6) {
-               str2prefix("::/0", &p);
+       memset(&p, 0, sizeof(p));
+       p.family = afi2family(afi);
+       p.prefixlen = 0;
 
+       if (afi == AFI_IP6) {
                /* IPv6 global nexthop must be included. */
                attr.mp_nexthop_len = BGP_ATTR_NHLEN_IPV6_GLOBAL;
 
@@ -759,10 +759,9 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw)
                         * clear adj_out for the 0.0.0.0/0 prefix in the BGP
                         * table.
                         */
-                       if (afi == AFI_IP)
-                               str2prefix("0.0.0.0/0", &p);
-                       else
-                               str2prefix("::/0", &p);
+                       memset(&p, 0, sizeof(p));
+                       p.family = afi2family(afi);
+                       p.prefixlen = 0;
 
                        rn = bgp_afi_node_get(bgp->rib[afi][safi], afi, safi,
                                              &p, NULL);