static int
lcommunity_regexp_include (regex_t * reg, struct lcommunity *lcom, int i)
{
- const char *str;
+ char *str;
/* When there is no communities attribute it is treated as empty string. */
if (lcom == NULL || lcom->size == 0)
- str = "";
+ str = XSTRDUP (MTYPE_LCOMMUNITY_STR, "");
else
str = lcommunity_str_get (lcom, i);
/* Regular expression match. */
if (regexec (reg, str, 0, NULL, 0) == 0)
- return 1;
+ {
+ XFREE (MTYPE_LCOMMUNITY_STR, str);
+ return 1;
+ }
+ XFREE (MTYPE_LCOMMUNITY_STR, str);
/* No match. */
return 0;
}
"Neighbor to display information about\n"
"Display routes learned from neighbor\n")
{
- int idx_peer = 5;
- union sockunion su;
+ int idx_peer = 0;
+ union sockunion *su;
struct peer *peer;
- if (sockunion_str2su (argv[idx_peer]->arg))
+ argv_find(argv, argc, "A.B.C.D", &idx_peer);
+ su = sockunion_str2su (argv[idx_peer]->arg);
+
+ if (!su)
{
vty_out (vty, "Malformed address: %s%s", argv[idx_peer]->arg, VTY_NEWLINE);
return CMD_WARNING;
}
- peer = peer_lookup (NULL, &su);
+ peer = peer_lookup (NULL, su);
if (! peer || ! peer->afc[AFI_IP][SAFI_ENCAP])
{
vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE);
return CMD_WARNING;
}
- return bgp_show_encap (vty, AFI_IP, NULL, bgp_show_type_neighbor, &su, 0);
+ return bgp_show_encap (vty, AFI_IP, NULL, bgp_show_type_neighbor, su, 0);
}
DEFUN (show_bgp_ipv6_encap_neighbor_routes,
if (route_length - 4 - 10 - 8 -
3 /* label to be read */ >= 32) {
p_evpn_p->flags = IP_PREFIX_V6;
- memcpy(&(p_evpn_p->ip.v4_addr), pnt, 16);
+ memcpy(&(p_evpn_p->ip.v6_addr), pnt, 16);
pnt += 16;
memcpy(&evpn.gw_ip.ipv6, pnt, 16);
pnt += 16;
int ret = community_list_unset (bgp_clist, cl_name_or_number, str, direct, style, delete_all);
+ XFREE (MTYPE_TMP, str);
+
if (ret < 0)
{
community_list_perror (vty, ret);
int ret = community_list_unset (bgp_clist, cl_name_or_number, str, direct, style, delete_all);
+ XFREE (MTYPE_TMP, str);
+
if (ret < 0)
{
community_list_perror (vty, ret);
list_delete (group->listen_range[afi]);
}
- XFREE(MTYPE_BGP_PEER_HOST, group->name);
+ XFREE(MTYPE_PEER_GROUP_HOST, group->name);
group->name = NULL;
group->conf->group = NULL;
if (gfilter->plist[direct].name)
{
if (filter->plist[direct].name)
- XSTRDUP(MTYPE_BGP_FILTER_NAME, filter->plist[direct].name);
+ XFREE(MTYPE_BGP_FILTER_NAME, filter->plist[direct].name);
filter->plist[direct].name = XSTRDUP(MTYPE_BGP_FILTER_NAME, gfilter->plist[direct].name);
filter->plist[direct].plist = gfilter->plist[direct].plist;
peer_on_policy_change(peer, afi, safi,
api.nexthop = nhp_ary;
api.ifindex_num = 0;
api.instance = 0;
+ api.safi = SAFI_UNICAST;
if (BGP_DEBUG (zebra, ZEBRA))
{
api.ifindex_num = 1;
api.ifindex = &ifindex;
api.instance = 0;
+ api.safi = SAFI_UNICAST;
if (BGP_DEBUG (zebra, ZEBRA))
{