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;
* 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);