summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_evpn.c2
-rw-r--r--bgpd/bgp_route.c2
-rw-r--r--bgpd/bgp_updgrp_adv.c15
-rw-r--r--bgpd/bgp_updgrp_packet.c14
-rw-r--r--bgpd/rfapi/rfapi_rib.c2
-rw-r--r--eigrpd/eigrp_vty.c4
-rw-r--r--vtysh/vtysh_main.c2
7 files changed, 19 insertions, 22 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c
index a09d966d7..182a6c64f 100644
--- a/bgpd/bgp_evpn.c
+++ b/bgpd/bgp_evpn.c
@@ -2542,7 +2542,7 @@ void bgp_evpn_derive_auto_rd(struct bgp *bgp, struct bgpevpn *vpn)
vpn->prd.family = AF_UNSPEC;
vpn->prd.prefixlen = 64;
sprintf(buf, "%s:%hu", inet_ntoa(bgp->router_id), vpn->rd_id);
- str2prefix_rd(buf, &vpn->prd);
+ (void)str2prefix_rd(buf, &vpn->prd);
UNSET_FLAG(vpn->flags, VNI_FLAG_RD_CFGD);
}
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 0c2a2f6fe..af71088b7 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -10545,7 +10545,7 @@ DEFUN (show_bgp_afi_vpn_rd_route,
afi_t afi = AFI_MAX;
int idx = 0;
- argv_find_and_parse_afi(argv, argc, &idx, &afi);
+ (void)argv_find_and_parse_afi(argv, argc, &idx, &afi);
ret = str2prefix_rd(argv[5]->arg, &prd);
if (!ret) {
vty_out(vty, "%% Malformed Route Distinguisher\n");
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);
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];
diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c
index 92cd1888e..36ae6e727 100644
--- a/bgpd/rfapi/rfapi_rib.c
+++ b/bgpd/rfapi/rfapi_rib.c
@@ -1668,7 +1668,7 @@ void rfapiRibUpdatePendingNode(
struct prefix pfx_vn;
- rfapiRaddr2Qprefix(&rfd->vn_addr, &pfx_vn);
+ assert(!rfapiRaddr2Qprefix(&rfd->vn_addr, &pfx_vn));
if (prefix_same(&pfx_vn, &pfx_nh))
continue;
}
diff --git a/eigrpd/eigrp_vty.c b/eigrpd/eigrp_vty.c
index 5fc781816..4e7642853 100644
--- a/eigrpd/eigrp_vty.c
+++ b/eigrpd/eigrp_vty.c
@@ -398,7 +398,7 @@ DEFUN (eigrp_network,
struct prefix p;
int ret;
- str2prefix(argv[1]->arg, &p);
+ (void)str2prefix(argv[1]->arg, &p);
ret = eigrp_network_set(eigrp, &p);
@@ -421,7 +421,7 @@ DEFUN (no_eigrp_network,
struct prefix p;
int ret;
- str2prefix(argv[2]->arg, &p);
+ (void)str2prefix(argv[2]->arg, &p);
ret = eigrp_network_unset(eigrp, &p);
diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c
index 8509a8a05..57042f8e6 100644
--- a/vtysh/vtysh_main.c
+++ b/vtysh/vtysh_main.c
@@ -533,7 +533,7 @@ int main(int argc, char **argv, char **env)
fp = open(history_file, O_CREAT | O_EXCL,
S_IRUSR | S_IWUSR);
- if (fp)
+ if (fp != -1)
close(fp);
read_history(history_file);