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);
}
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");
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);
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)) {
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];
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;
}
struct prefix p;
int ret;
- str2prefix(argv[1]->arg, &p);
+ (void)str2prefix(argv[1]->arg, &p);
ret = eigrp_network_set(eigrp, &p);
struct prefix p;
int ret;
- str2prefix(argv[2]->arg, &p);
+ (void)str2prefix(argv[2]->arg, &p);
ret = eigrp_network_unset(eigrp, &p);
fp = open(history_file, O_CREAT | O_EXCL,
S_IRUSR | S_IWUSR);
- if (fp)
+ if (fp != -1)
close(fp);
read_history(history_file);