diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2017-10-23 23:19:26 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2017-10-24 23:30:30 +0200 |
commit | cbb65f5ef53d9029811e248608125ffa293753eb (patch) | |
tree | 20cad1b8d174a57e67b0f6ec637552409c597041 /bgpd/bgp_updgrp_adv.c | |
parent | *: fix coverity warnings - resource leaks (diff) | |
download | frr-cbb65f5ef53d9029811e248608125ffa293753eb.tar.xz frr-cbb65f5ef53d9029811e248608125ffa293753eb.zip |
*: fix coverity warnings - error handling issues
Ignore the return value of some functions in the places we know they
can't fail, and other small fixes.
Regarding the change in bgpd/rfapi/rfapi_rib.c, asserting that
rfapiRaddr2Qprefix() didn't fail is the common idiom inside the rfapi
code.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_updgrp_adv.c')
-rw-r--r-- | bgpd/bgp_updgrp_adv.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c index fbbeaee9b..8a24cba59 100644 --- a/bgpd/bgp_updgrp_adv.c +++ b/bgpd/bgp_updgrp_adv.c @@ -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); |