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_packet.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_packet.c')
-rw-r--r-- | bgpd/bgp_updgrp_packet.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c index 433c5ce51..a35d814e4 100644 --- a/bgpd/bgp_updgrp_packet.c +++ b/bgpd/bgp_updgrp_packet.c @@ -1090,10 +1090,9 @@ void subgroup_default_update_packet(struct update_subgroup *subgrp, bpacket_attr_vec_arr_reset(&vecarr); addpath_encode = bgp_addpath_encode_tx(peer, afi, safi); - 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; /* Logging the attribute. */ if (bgp_debug_update(NULL, &p, subgrp->update_group, 0)) { @@ -1176,10 +1175,9 @@ void subgroup_default_withdraw_packet(struct update_subgroup *subgrp) safi = SUBGRP_SAFI(subgrp); addpath_encode = bgp_addpath_encode_tx(peer, afi, safi); - 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; if (bgp_debug_update(NULL, &p, subgrp->update_group, 0)) { char buf[PREFIX_STRLEN]; |