mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 02:22:48 +00:00
pimd: Cleanup use of VRF_DEFAULT to pimg->vrf_id
Use the appropriate vrf_id instead of always defaulting to VRF_DEFAULT Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
6f2f0be832
commit
0708beb1f4
@ -533,7 +533,7 @@ static void igmp_show_interfaces(struct vty *vty, u_char uj)
|
||||
vty_out(vty,
|
||||
"Interface State Address V Querier Query Timer Uptime\n");
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), node, ifp)) {
|
||||
struct pim_interface *pim_ifp;
|
||||
struct listnode *sock_node;
|
||||
struct igmp_sock *igmp;
|
||||
@ -623,7 +623,7 @@ static void igmp_show_interfaces_single(struct vty *vty, const char *ifname,
|
||||
|
||||
now = pim_time_monotonic_sec();
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), node, ifp)) {
|
||||
pim_ifp = ifp->info;
|
||||
|
||||
if (!pim_ifp)
|
||||
@ -804,7 +804,7 @@ static void igmp_show_interface_join(struct vty *vty)
|
||||
vty_out(vty,
|
||||
"Interface Address Source Group Socket Uptime \n");
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), node, ifp)) {
|
||||
struct pim_interface *pim_ifp;
|
||||
struct listnode *join_node;
|
||||
struct igmp_join *ij;
|
||||
@ -884,7 +884,7 @@ static void pim_show_interfaces_single(struct vty *vty, const char *ifname,
|
||||
if (uj)
|
||||
json = json_object_new_object();
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), node, ifp)) {
|
||||
pim_ifp = ifp->info;
|
||||
|
||||
if (!pim_ifp)
|
||||
@ -1165,9 +1165,8 @@ static void pim_show_interfaces_single(struct vty *vty, const char *ifname,
|
||||
print_header = 1;
|
||||
for (ALL_LIST_ELEMENTS_RO(pim_upstream_list, upnode,
|
||||
up)) {
|
||||
if (strcmp(ifp->name,
|
||||
up->rpf.source_nexthop
|
||||
.interface->name)
|
||||
if (strcmp(ifp->name, up->rpf.source_nexthop
|
||||
.interface->name)
|
||||
== 0) {
|
||||
if (up->flags
|
||||
& PIM_UPSTREAM_FLAG_MASK_FHR) {
|
||||
@ -1279,7 +1278,7 @@ static void pim_show_interfaces(struct vty *vty, u_char uj)
|
||||
|
||||
json = json_object_new_object();
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), node, ifp)) {
|
||||
pim_ifp = ifp->info;
|
||||
|
||||
if (!pim_ifp)
|
||||
@ -1381,7 +1380,7 @@ static void pim_show_interface_traffic(struct vty *vty, u_char uj)
|
||||
"---------------------------------------------------------------------------------------------------------------\n");
|
||||
}
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), node, ifp)) {
|
||||
pim_ifp = ifp->info;
|
||||
|
||||
if (!pim_ifp)
|
||||
@ -1462,7 +1461,7 @@ static void pim_show_interface_traffic_single(struct vty *vty,
|
||||
"---------------------------------------------------------------------------------------------------------------\n");
|
||||
}
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), node, ifp)) {
|
||||
if (strcmp(ifname, ifp->name))
|
||||
continue;
|
||||
|
||||
@ -1657,7 +1656,7 @@ static void pim_show_neighbors_single(struct vty *vty, const char *neighbor,
|
||||
if (uj)
|
||||
json = json_object_new_object();
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), node, ifp)) {
|
||||
pim_ifp = ifp->info;
|
||||
|
||||
if (!pim_ifp)
|
||||
@ -2063,7 +2062,7 @@ static void pim_show_neighbors(struct vty *vty, u_char uj)
|
||||
"Interface Neighbor Uptime Holdtime DR Pri\n");
|
||||
}
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), node, ifp)) {
|
||||
pim_ifp = ifp->info;
|
||||
|
||||
if (!pim_ifp)
|
||||
@ -2129,7 +2128,7 @@ static void pim_show_neighbors_secondary(struct vty *vty)
|
||||
vty_out(vty,
|
||||
"Interface Address Neighbor Secondary \n");
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), node, ifp)) {
|
||||
struct pim_interface *pim_ifp;
|
||||
struct in_addr ifaddr;
|
||||
struct listnode *neighnode;
|
||||
@ -2661,7 +2660,7 @@ static int pim_print_pnc_cache_walkcb(struct hash_backet *backet, void *arg)
|
||||
|
||||
for (nh_node = pnc->nexthop; nh_node; nh_node = nh_node->next) {
|
||||
first_ifindex = nh_node->ifindex;
|
||||
ifp = if_lookup_by_index(first_ifindex, VRF_DEFAULT);
|
||||
ifp = if_lookup_by_index(first_ifindex, pimg->vrf_id);
|
||||
|
||||
vty_out(vty, "%-15s ", inet_ntoa(pnc->rpf.rpf_addr.u.prefix4));
|
||||
vty_out(vty, "%-14s ", ifp ? ifp->name : "NULL");
|
||||
@ -2705,7 +2704,7 @@ static void igmp_show_groups(struct vty *vty, u_char uj)
|
||||
"Interface Address Group Mode Timer Srcs V Uptime \n");
|
||||
|
||||
/* scan interfaces */
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), ifnode, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), ifnode, ifp)) {
|
||||
struct pim_interface *pim_ifp = ifp->info;
|
||||
struct listnode *sock_node;
|
||||
struct igmp_sock *igmp;
|
||||
@ -2817,7 +2816,7 @@ static void igmp_show_group_retransmission(struct vty *vty)
|
||||
"Interface Address Group RetTimer Counter RetSrcs\n");
|
||||
|
||||
/* scan interfaces */
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), ifnode, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), ifnode, ifp)) {
|
||||
struct pim_interface *pim_ifp = ifp->info;
|
||||
struct listnode *sock_node;
|
||||
struct igmp_sock *igmp;
|
||||
@ -2885,7 +2884,7 @@ static void igmp_show_sources(struct vty *vty)
|
||||
"Interface Address Group Source Timer Fwd Uptime \n");
|
||||
|
||||
/* scan interfaces */
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), ifnode, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), ifnode, ifp)) {
|
||||
struct pim_interface *pim_ifp = ifp->info;
|
||||
struct listnode *sock_node;
|
||||
struct igmp_sock *igmp;
|
||||
@ -2958,7 +2957,7 @@ static void igmp_show_source_retransmission(struct vty *vty)
|
||||
"Interface Address Group Source Counter\n");
|
||||
|
||||
/* scan interfaces */
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), ifnode, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), ifnode, ifp)) {
|
||||
struct pim_interface *pim_ifp = ifp->info;
|
||||
struct listnode *sock_node;
|
||||
struct igmp_sock *igmp;
|
||||
@ -3014,12 +3013,12 @@ static void clear_igmp_interfaces()
|
||||
struct listnode *ifnextnode;
|
||||
struct interface *ifp;
|
||||
|
||||
for (ALL_LIST_ELEMENTS(vrf_iflist(VRF_DEFAULT), ifnode, ifnextnode,
|
||||
for (ALL_LIST_ELEMENTS(vrf_iflist(pimg->vrf_id), ifnode, ifnextnode,
|
||||
ifp)) {
|
||||
pim_if_addr_del_all_igmp(ifp);
|
||||
}
|
||||
|
||||
for (ALL_LIST_ELEMENTS(vrf_iflist(VRF_DEFAULT), ifnode, ifnextnode,
|
||||
for (ALL_LIST_ELEMENTS(vrf_iflist(pimg->vrf_id), ifnode, ifnextnode,
|
||||
ifp)) {
|
||||
pim_if_addr_add_all(ifp);
|
||||
}
|
||||
@ -3031,7 +3030,7 @@ static void clear_pim_interfaces()
|
||||
struct listnode *ifnextnode;
|
||||
struct interface *ifp;
|
||||
|
||||
for (ALL_LIST_ELEMENTS(vrf_iflist(VRF_DEFAULT), ifnode, ifnextnode,
|
||||
for (ALL_LIST_ELEMENTS(vrf_iflist(pimg->vrf_id), ifnode, ifnextnode,
|
||||
ifp)) {
|
||||
if (ifp->info) {
|
||||
pim_neighbor_delete_all(ifp, "interface cleared");
|
||||
@ -3152,7 +3151,7 @@ DEFUN (clear_ip_pim_interface_traffic,
|
||||
struct interface *ifp = NULL;
|
||||
struct pim_interface *pim_ifp = NULL;
|
||||
|
||||
for (ALL_LIST_ELEMENTS(vrf_iflist(VRF_DEFAULT), ifnode, ifnextnode,
|
||||
for (ALL_LIST_ELEMENTS(vrf_iflist(pimg->vrf_id), ifnode, ifnextnode,
|
||||
ifp)) {
|
||||
pim_ifp = ifp->info;
|
||||
|
||||
@ -3647,7 +3646,7 @@ static void show_multicast_interfaces(struct vty *vty)
|
||||
vty_out(vty,
|
||||
"Interface Address ifi Vif PktsIn PktsOut BytesIn BytesOut\n");
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), node, ifp)) {
|
||||
struct pim_interface *pim_ifp;
|
||||
struct in_addr ifaddr;
|
||||
struct sioc_vif_req vreq;
|
||||
@ -4560,7 +4559,7 @@ DEFUN (no_ip_pim_rp_prefix_list,
|
||||
|
||||
static int pim_ssm_cmd_worker(struct vty *vty, const char *plist)
|
||||
{
|
||||
int result = pim_ssm_range_set(VRF_DEFAULT, plist);
|
||||
int result = pim_ssm_range_set(pimg->vrf_id, plist);
|
||||
|
||||
if (result == PIM_SSM_ERR_NONE)
|
||||
return CMD_SUCCESS;
|
||||
@ -5585,7 +5584,7 @@ DEFUN (interface_ip_mroute,
|
||||
int result;
|
||||
|
||||
oifname = argv[idx_interface]->arg;
|
||||
oif = if_lookup_by_name(oifname, VRF_DEFAULT);
|
||||
oif = if_lookup_by_name(oifname, pimg->vrf_id);
|
||||
if (!oif) {
|
||||
vty_out(vty, "No such interface name %s\n", oifname);
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
@ -5631,7 +5630,7 @@ DEFUN (interface_ip_mroute_source,
|
||||
int result;
|
||||
|
||||
oifname = argv[idx_interface]->arg;
|
||||
oif = if_lookup_by_name(oifname, VRF_DEFAULT);
|
||||
oif = if_lookup_by_name(oifname, pimg->vrf_id);
|
||||
if (!oif) {
|
||||
vty_out(vty, "No such interface name %s\n", oifname);
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
@ -5681,7 +5680,7 @@ DEFUN (interface_no_ip_mroute,
|
||||
int result;
|
||||
|
||||
oifname = argv[idx_interface]->arg;
|
||||
oif = if_lookup_by_name(oifname, VRF_DEFAULT);
|
||||
oif = if_lookup_by_name(oifname, pimg->vrf_id);
|
||||
if (!oif) {
|
||||
vty_out(vty, "No such interface name %s\n", oifname);
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
@ -5728,7 +5727,7 @@ DEFUN (interface_no_ip_mroute_source,
|
||||
int result;
|
||||
|
||||
oifname = argv[idx_interface]->arg;
|
||||
oif = if_lookup_by_name(oifname, VRF_DEFAULT);
|
||||
oif = if_lookup_by_name(oifname, pimg->vrf_id);
|
||||
if (!oif) {
|
||||
vty_out(vty, "No such interface name %s\n", oifname);
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
|
@ -938,7 +938,7 @@ struct in_addr pim_find_primary_addr(struct interface *ifp)
|
||||
*/
|
||||
if (!v4_addrs && v6_addrs && !if_is_loopback(ifp)) {
|
||||
struct interface *lo_ifp;
|
||||
lo_ifp = if_lookup_by_name("lo", VRF_DEFAULT);
|
||||
lo_ifp = if_lookup_by_name("lo", pimg->vrf_id);
|
||||
if (lo_ifp)
|
||||
return pim_find_primary_addr(lo_ifp);
|
||||
}
|
||||
@ -1054,7 +1054,7 @@ void pim_if_add_vif_all()
|
||||
struct listnode *ifnextnode;
|
||||
struct interface *ifp;
|
||||
|
||||
for (ALL_LIST_ELEMENTS(vrf_iflist(VRF_DEFAULT), ifnode, ifnextnode,
|
||||
for (ALL_LIST_ELEMENTS(vrf_iflist(pimg->vrf_id), ifnode, ifnextnode,
|
||||
ifp)) {
|
||||
if (!ifp->info)
|
||||
continue;
|
||||
@ -1069,7 +1069,7 @@ void pim_if_del_vif_all()
|
||||
struct listnode *ifnextnode;
|
||||
struct interface *ifp;
|
||||
|
||||
for (ALL_LIST_ELEMENTS(vrf_iflist(VRF_DEFAULT), ifnode, ifnextnode,
|
||||
for (ALL_LIST_ELEMENTS(vrf_iflist(pimg->vrf_id), ifnode, ifnextnode,
|
||||
ifp)) {
|
||||
if (!ifp->info)
|
||||
continue;
|
||||
@ -1084,9 +1084,9 @@ struct interface *pim_if_find_by_vif_index(ifindex_t vif_index)
|
||||
struct interface *ifp;
|
||||
|
||||
if (vif_index == 0)
|
||||
return if_lookup_by_name("pimreg", VRF_DEFAULT);
|
||||
return if_lookup_by_name("pimreg", pimg->vrf_id);
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), ifnode, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), ifnode, ifp)) {
|
||||
if (ifp->info) {
|
||||
struct pim_interface *pim_ifp;
|
||||
pim_ifp = ifp->info;
|
||||
@ -1107,7 +1107,7 @@ int pim_if_find_vifindex_by_ifindex(ifindex_t ifindex)
|
||||
struct pim_interface *pim_ifp;
|
||||
struct interface *ifp;
|
||||
|
||||
ifp = if_lookup_by_index(ifindex, VRF_DEFAULT);
|
||||
ifp = if_lookup_by_index(ifindex, pimg->vrf_id);
|
||||
if (!ifp || !ifp->info)
|
||||
return -1;
|
||||
pim_ifp = ifp->info;
|
||||
@ -1566,7 +1566,7 @@ void pim_if_create_pimreg(void)
|
||||
{
|
||||
if (!pim_regiface) {
|
||||
pim_regiface =
|
||||
if_create("pimreg", strlen("pimreg"), VRF_DEFAULT);
|
||||
if_create("pimreg", strlen("pimreg"), pimg->vrf_id);
|
||||
pim_regiface->ifindex = PIM_OIF_PIM_REGISTER_VIF;
|
||||
|
||||
pim_if_new(pim_regiface, 0, 0);
|
||||
|
@ -1265,7 +1265,7 @@ void pim_ifchannel_scan_forward_start(struct interface *new_ifp)
|
||||
struct interface *ifp;
|
||||
struct pim_interface *new_pim_ifp = new_ifp->info;
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), ifnode, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), ifnode, ifp)) {
|
||||
struct pim_interface *loop_pim_ifp = ifp->info;
|
||||
struct listnode *ch_node;
|
||||
struct pim_ifchannel *ch;
|
||||
|
@ -216,7 +216,7 @@ void pim_jp_agg_upstream_verification(struct pim_upstream *up, bool ignore)
|
||||
struct listnode *node;
|
||||
struct interface *ifp;
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), node, ifp)) {
|
||||
struct pim_interface *pim_ifp = ifp->info;
|
||||
struct listnode *nnode;
|
||||
|
||||
|
@ -523,7 +523,7 @@ int pim_mroute_msg(int fd, const char *buf, int buf_size)
|
||||
* the source
|
||||
* of the IP packet.
|
||||
*/
|
||||
ifp = pim_if_lookup_address_vrf(ip_hdr->ip_src, VRF_DEFAULT);
|
||||
ifp = pim_if_lookup_address_vrf(ip_hdr->ip_src, pimg->vrf_id);
|
||||
|
||||
if (!ifp) {
|
||||
if (PIM_DEBUG_MROUTE_DETAIL) {
|
||||
|
@ -58,7 +58,7 @@ void pim_sendmsg_zebra_rnh(struct zclient *zclient,
|
||||
p = &(pnc->rpf.rpf_addr);
|
||||
s = zclient->obuf;
|
||||
stream_reset(s);
|
||||
zclient_create_header(s, command, VRF_DEFAULT);
|
||||
zclient_create_header(s, command, pimg->vrf_id);
|
||||
/* get update for all routes for a prefix */
|
||||
stream_putc(s, 0);
|
||||
|
||||
@ -303,7 +303,7 @@ void pim_resolve_upstream_nh(struct prefix *nht_p)
|
||||
for (nh_node = pnc.nexthop; nh_node; nh_node = nh_node->next) {
|
||||
if (nh_node->gate.ipv4.s_addr == 0) {
|
||||
struct interface *ifp1 = if_lookup_by_index(
|
||||
nh_node->ifindex, VRF_DEFAULT);
|
||||
nh_node->ifindex, pimg->vrf_id);
|
||||
nbr = pim_neighbor_find_if(ifp1);
|
||||
if (nbr) {
|
||||
nh_node->gate.ipv4 = nbr->source_addr;
|
||||
@ -437,7 +437,7 @@ static int pim_update_upstream_nh(struct pim_nexthop_cache *pnc)
|
||||
}
|
||||
} /* for (pnc->upstream_list) */
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), ifnode, ifp))
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), ifnode, ifp))
|
||||
if (ifp->info) {
|
||||
struct pim_interface *pim_ifp = ifp->info;
|
||||
struct pim_iface_upstream_switch *us;
|
||||
@ -568,7 +568,7 @@ int pim_ecmp_nexthop_search(struct pim_nexthop_cache *pnc,
|
||||
for (nh_node = pnc->nexthop; nh_node && (found == 0);
|
||||
nh_node = nh_node->next) {
|
||||
first_ifindex = nh_node->ifindex;
|
||||
ifp = if_lookup_by_index(first_ifindex, VRF_DEFAULT);
|
||||
ifp = if_lookup_by_index(first_ifindex, pimg->vrf_id);
|
||||
if (!ifp) {
|
||||
if (PIM_DEBUG_ZEBRA) {
|
||||
char addr_str[INET_ADDRSTRLEN];
|
||||
@ -746,7 +746,7 @@ int pim_parse_nexthop_update(int command, struct zclient *zclient,
|
||||
stream_get(&nexthop->gate.ipv6, s, 16);
|
||||
nexthop->ifindex = stream_getl(s);
|
||||
ifp1 = if_lookup_by_index(nexthop->ifindex,
|
||||
VRF_DEFAULT);
|
||||
pimg->vrf_id);
|
||||
nbr = pim_neighbor_find_if(ifp1);
|
||||
/* Overwrite with Nbr address as NH addr */
|
||||
if (nbr) {
|
||||
@ -793,7 +793,8 @@ int pim_parse_nexthop_update(int command, struct zclient *zclient,
|
||||
nexthop->type, distance, metric);
|
||||
}
|
||||
|
||||
ifp = if_lookup_by_index(nexthop->ifindex, VRF_DEFAULT);
|
||||
ifp = if_lookup_by_index(nexthop->ifindex,
|
||||
pimg->vrf_id);
|
||||
if (!ifp) {
|
||||
if (PIM_DEBUG_ZEBRA) {
|
||||
char buf[NEXTHOP_STRLEN];
|
||||
@ -913,7 +914,7 @@ int pim_ecmp_nexthop_lookup(struct pim_nexthop *nexthop, struct in_addr addr,
|
||||
while (!found && (i < num_ifindex)) {
|
||||
first_ifindex = nexthop_tab[i].ifindex;
|
||||
|
||||
ifp = if_lookup_by_index(first_ifindex, VRF_DEFAULT);
|
||||
ifp = if_lookup_by_index(first_ifindex, pimg->vrf_id);
|
||||
if (!ifp) {
|
||||
if (PIM_DEBUG_ZEBRA) {
|
||||
char addr_str[INET_ADDRSTRLEN];
|
||||
@ -1048,7 +1049,7 @@ int pim_ecmp_fib_lookup_if_vif_index(struct in_addr addr, struct prefix *src,
|
||||
zlog_debug(
|
||||
"%s %s: found nexthop ifindex=%d (interface %s) for address %s",
|
||||
__FILE__, __PRETTY_FUNCTION__, first_ifindex,
|
||||
ifindex2ifname(first_ifindex, VRF_DEFAULT), addr_str);
|
||||
ifindex2ifname(first_ifindex, pimg->vrf_id), addr_str);
|
||||
}
|
||||
|
||||
vif_index = pim_if_find_vifindex_by_ifindex(first_ifindex);
|
||||
|
@ -334,7 +334,7 @@ static int pim_sock_read(struct thread *t)
|
||||
sizeof(to_str)))
|
||||
sprintf(to_str, "<to?>");
|
||||
|
||||
recv_ifp = if_lookup_by_index(ifindex, VRF_DEFAULT);
|
||||
recv_ifp = if_lookup_by_index(ifindex, pimg->vrf_id);
|
||||
if (recv_ifp) {
|
||||
zassert(ifindex == (int)recv_ifp->ifindex);
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ static void pim_rp_check_interfaces(struct rp_info *rp_info)
|
||||
struct interface *ifp;
|
||||
|
||||
rp_info->i_am_rp = 0;
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), node, ifp)) {
|
||||
struct pim_interface *pim_ifp = ifp->info;
|
||||
|
||||
if (!pim_ifp)
|
||||
@ -842,7 +842,7 @@ int pim_rp_check_is_my_ip_address(struct in_addr group,
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (if_lookup_exact_address(&dest_addr, AF_INET, VRF_DEFAULT))
|
||||
if (if_lookup_exact_address(&dest_addr, AF_INET, pimg->vrf_id))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
@ -979,7 +979,7 @@ void pim_resolve_rp_nh(void)
|
||||
nbr = pim_neighbor_find_if(
|
||||
if_lookup_by_index(
|
||||
nh_node->ifindex,
|
||||
VRF_DEFAULT));
|
||||
pimg->vrf_id));
|
||||
if (nbr) {
|
||||
nh_node->gate.ipv4 =
|
||||
nbr->source_addr;
|
||||
@ -990,7 +990,7 @@ void pim_resolve_rp_nh(void)
|
||||
struct interface *ifp1 =
|
||||
if_lookup_by_index(
|
||||
nh_node->ifindex,
|
||||
VRF_DEFAULT);
|
||||
pimg->vrf_id);
|
||||
pim_inet4_dump(
|
||||
"<nht_nbr?>",
|
||||
nbr->source_addr,
|
||||
|
@ -105,7 +105,7 @@ int pim_nexthop_lookup(struct pim_nexthop *nexthop, struct in_addr addr,
|
||||
while (!found && (i < num_ifindex)) {
|
||||
first_ifindex = nexthop_tab[i].ifindex;
|
||||
|
||||
ifp = if_lookup_by_index(first_ifindex, VRF_DEFAULT);
|
||||
ifp = if_lookup_by_index(first_ifindex, pimg->vrf_id);
|
||||
if (!ifp) {
|
||||
if (PIM_DEBUG_ZEBRA) {
|
||||
char addr_str[INET_ADDRSTRLEN];
|
||||
|
@ -105,7 +105,7 @@ int pim_ssm_range_set(vrf_id_t vrf_id, const char *plist_name)
|
||||
struct pim_ssm *ssm;
|
||||
int change = 0;
|
||||
|
||||
if (vrf_id != VRF_DEFAULT)
|
||||
if (vrf_id != pimg->vrf_id)
|
||||
return PIM_SSM_ERR_NO_VRF;
|
||||
|
||||
ssm = pimg->ssm_info;
|
||||
|
@ -272,7 +272,7 @@ static int ssmpingd_read_msg(struct ssmpingd_sock *ss)
|
||||
return -1;
|
||||
}
|
||||
|
||||
ifp = if_lookup_by_index(ifindex, VRF_DEFAULT);
|
||||
ifp = if_lookup_by_index(ifindex, pimg->vrf_id);
|
||||
|
||||
if (buf[0] != PIM_SSMPINGD_REQUEST) {
|
||||
char source_str[INET_ADDRSTRLEN];
|
||||
|
@ -850,7 +850,7 @@ int pim_upstream_evaluate_join_desired(struct pim_upstream *up)
|
||||
struct pim_upstream *starup = up->parent;
|
||||
int ret = 0;
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), node, ifp)) {
|
||||
if (!ifp->info)
|
||||
continue;
|
||||
|
||||
@ -1400,7 +1400,7 @@ int pim_upstream_inherited_olist_decide(struct pim_upstream *up)
|
||||
up->channel_oil =
|
||||
pim_channel_oil_add(&up->sg, pim_ifp->mroute_vif_index);
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), node, ifp)) {
|
||||
if (!ifp->info)
|
||||
continue;
|
||||
|
||||
|
@ -220,7 +220,7 @@ int pim_interface_config_write(struct vty *vty)
|
||||
struct listnode *node;
|
||||
struct interface *ifp;
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), node, ifp)) {
|
||||
|
||||
/* IF name */
|
||||
vty_out(vty, "interface %s\n", ifp->name);
|
||||
|
@ -292,7 +292,7 @@ static int pim_zebra_if_address_add(int command, struct zclient *zclient,
|
||||
struct listnode *ifnode;
|
||||
struct interface *ifp;
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), ifnode,
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), ifnode,
|
||||
ifp)) {
|
||||
if (!if_is_loopback(ifp) && if_is_operative(ifp))
|
||||
pim_if_addr_add_all(ifp);
|
||||
@ -434,7 +434,7 @@ static void scan_upstream_rpf_cache()
|
||||
|
||||
} /* for (qpim_upstream_list) */
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), ifnode, ifp))
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), ifnode, ifp))
|
||||
if (ifp->info) {
|
||||
struct pim_interface *pim_ifp = ifp->info;
|
||||
struct pim_iface_upstream_switch *us;
|
||||
@ -649,7 +649,7 @@ static void pim_zebra_connected(struct zclient *zclient)
|
||||
/* Send the client registration */
|
||||
bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER);
|
||||
|
||||
zclient_send_reg_requests(zclient, VRF_DEFAULT);
|
||||
zclient_send_reg_requests(zclient, pimg->vrf_id);
|
||||
}
|
||||
|
||||
void pim_zebra_init(void)
|
||||
@ -689,7 +689,7 @@ void pim_zebra_init(void)
|
||||
for (i = 0; i < ZEBRA_ROUTE_MAX; i++) {
|
||||
if (i == zclient->redist_default)
|
||||
continue;
|
||||
vrf_bitmap_set(zclient->redist[AFI_IP][i], VRF_DEFAULT);
|
||||
vrf_bitmap_set(zclient->redist[AFI_IP][i], pimg->vrf_id);
|
||||
;
|
||||
if (PIM_DEBUG_PIM_TRACE) {
|
||||
zlog_debug("%s: requesting redistribution for %s (%i)",
|
||||
@ -700,7 +700,7 @@ void pim_zebra_init(void)
|
||||
|
||||
/* Request default information */
|
||||
zclient_redistribute_default(ZEBRA_REDISTRIBUTE_DEFAULT_ADD, zclient,
|
||||
VRF_DEFAULT);
|
||||
pimg->vrf_id);
|
||||
|
||||
if (PIM_DEBUG_PIM_TRACE) {
|
||||
zlog_info("%s: requesting default information redistribution",
|
||||
@ -786,7 +786,7 @@ void igmp_source_forward_reevaluate_all(void)
|
||||
struct listnode *ifnode;
|
||||
struct interface *ifp;
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), ifnode, ifp)) {
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pimg->vrf_id), ifnode, ifp)) {
|
||||
struct pim_interface *pim_ifp = ifp->info;
|
||||
struct listnode *sock_node;
|
||||
struct igmp_sock *igmp;
|
||||
|
@ -261,12 +261,12 @@ static int zclient_read_nexthop(struct zclient *zlookup,
|
||||
if_lookup_by_index(
|
||||
nexthop_tab[num_ifindex]
|
||||
.ifindex,
|
||||
VRF_DEFAULT),
|
||||
pimg->vrf_id),
|
||||
&p);
|
||||
else
|
||||
nbr = pim_neighbor_find_if(if_lookup_by_index(
|
||||
nexthop_tab[num_ifindex].ifindex,
|
||||
VRF_DEFAULT));
|
||||
pimg->vrf_id));
|
||||
if (nbr) {
|
||||
nexthop_tab[num_ifindex].nexthop_addr.family =
|
||||
AF_INET;
|
||||
@ -316,7 +316,7 @@ static int zclient_lookup_nexthop_once(struct pim_zlookup_nexthop nexthop_tab[],
|
||||
|
||||
s = zlookup->obuf;
|
||||
stream_reset(s);
|
||||
zclient_create_header(s, ZEBRA_IPV4_NEXTHOP_LOOKUP_MRIB, VRF_DEFAULT);
|
||||
zclient_create_header(s, ZEBRA_IPV4_NEXTHOP_LOOKUP_MRIB, pimg->vrf_id);
|
||||
stream_put_in_addr(s, &addr);
|
||||
stream_putw_at(s, 0, stream_get_endp(s));
|
||||
|
||||
@ -488,7 +488,7 @@ int pim_zlookup_sg_statistics(struct channel_oil *c_oil)
|
||||
return -1;
|
||||
|
||||
stream_reset(s);
|
||||
zclient_create_header(s, ZEBRA_IPMR_ROUTE_STATS, VRF_DEFAULT);
|
||||
zclient_create_header(s, ZEBRA_IPMR_ROUTE_STATS, pimg->vrf_id);
|
||||
stream_put_in_addr(s, &c_oil->oil.mfcc_origin);
|
||||
stream_put_in_addr(s, &c_oil->oil.mfcc_mcastgrp);
|
||||
stream_putl(s, ifp->ifindex);
|
||||
|
Loading…
Reference in New Issue
Block a user