}
}
} else if (if_lookup_exact_address(&ip_hdr->ip_dst, AF_INET,
- pim->vrf_id)) {
+ pim->vrf->vrf_id)) {
/* Unicast BSM received - if ucast bsm not enabled on
* the interface, drop it
*/
if (uj) {
json = json_object_new_object();
json_object_string_add(json, "vrf",
- vrf_id_to_name(pim->vrf_id));
+ vrf_id_to_name(pim->vrf->vrf_id));
} else {
vty_out(vty,
"Interface Address Source Group Socket Uptime \n");
for (nh_node = pnc->nexthop; nh_node; nh_node = nh_node->next) {
first_ifindex = nh_node->ifindex;
- ifp = if_lookup_by_index(first_ifindex, pim->vrf_id);
+ ifp = if_lookup_by_index(first_ifindex, pim->vrf->vrf_id);
vty_out(vty, "%-15s ", inet_ntop(AF_INET,
&pnc->rpf.rpf_addr.u.prefix4,
struct pim_interface *pim_ifp;
struct interface *ifp;
- ifp = if_lookup_by_index(ifindex, pim->vrf_id);
+ ifp = if_lookup_by_index(ifindex, pim->vrf->vrf_id);
if (!ifp || !ifp->info)
return -1;
pim_ifp = ifp->info;
char pimreg_name[INTERFACE_NAMSIZ];
if (!pim->regiface) {
- if (pim->vrf_id == VRF_DEFAULT)
+ if (pim->vrf->vrf_id == VRF_DEFAULT)
strlcpy(pimreg_name, "pimreg", sizeof(pimreg_name));
else
snprintf(pimreg_name, sizeof(pimreg_name), "pimreg%u",
pim->vrf->data.l.table_id);
- pim->regiface = if_create_name(pimreg_name, pim->vrf_id);
+ pim->regiface = if_create_name(pimreg_name, pim->vrf->vrf_id);
pim->regiface->ifindex = PIM_OIF_PIM_REGISTER_VIF;
pim_if_new(pim->regiface, false, false, true,
*/
if (!IPV4_CLASS_DE(ntohl(ip_hdr->ip_dst.s_addr)))
if (!if_lookup_exact_address(&ip_hdr->ip_dst, AF_INET,
- pim->vrf_id))
+ pim->vrf->vrf_id))
return mtrace_forward_packet(pim, ip_hdr);
if (igmp_msg_len < (int)sizeof(struct igmp_mtrace)) {
pim->ecmp_enable = false;
pim->ecmp_rebalance_enable = false;
- pim->vrf_id = vrf->vrf_id;
pim->vrf = vrf;
pim->spt.switchover = PIM_SPT_IMMEDIATE;
struct pim_instance *pim = (struct pim_instance *)vrf->info;
struct interface *ifp;
- zlog_debug("%s: for %s", __func__, vrf->name);
+ zlog_debug("%s: for %s %u", __func__, vrf->name, vrf->vrf_id);
FOR_ALL_INTERFACES (vrf, ifp) {
if (!ifp->info)
/* Per VRF PIM DB */
struct pim_instance {
- vrf_id_t vrf_id;
+ // vrf_id_t vrf_id;
struct vrf *vrf;
struct {
/*
* We need to create the VRF table for the pim mroute_socket
*/
- if (pim->vrf_id != VRF_DEFAULT) {
+ if (pim->vrf->vrf_id != VRF_DEFAULT) {
frr_with_privs(&pimd_privs) {
data = pim->vrf->data.l.table_id;
* the source
* of the IP packet.
*/
- ifp = if_lookup_by_index(ifindex, pim->vrf_id);
+ ifp = if_lookup_by_index(ifindex, pim->vrf->vrf_id);
if (!ifp || !ifp->info)
return 0;
sockopt_reuseaddr(sock);
sockopt_reuseport(sock);
- if (pim->vrf_id != VRF_DEFAULT) {
+ if (pim->vrf->vrf_id != VRF_DEFAULT) {
struct interface *ifp =
- if_lookup_by_name(pim->vrf->name, pim->vrf_id);
+ if_lookup_by_name(pim->vrf->name, pim->vrf->vrf_id);
if (!ifp) {
flog_err(EC_LIB_INTERFACE,
"%s: Unable to lookup vrf interface: %s",
return -1;
}
- if (mp->pim->vrf_id != VRF_DEFAULT) {
- struct interface *ifp =
- if_lookup_by_name(mp->pim->vrf->name, mp->pim->vrf_id);
+ if (mp->pim->vrf->vrf_id != VRF_DEFAULT) {
+ struct interface *ifp = if_lookup_by_name(mp->pim->vrf->name,
+ mp->pim->vrf->vrf_id);
if (!ifp) {
flog_err(EC_LIB_INTERFACE,
"%s: Unable to lookup vrf interface: %s",
static int pim_ssm_cmd_worker(struct pim_instance *pim, const char *plist,
char *errmsg, size_t errmsg_len)
{
- int result = pim_ssm_range_set(pim, pim->vrf_id, plist);
+ int result = pim_ssm_range_set(pim, pim->vrf->vrf_id, plist);
int ret = NB_ERR;
if (result == PIM_SSM_ERR_NONE)
pim = pim_iifp->pim;
oifname = yang_dnode_get_string(args->dnode, "./oif");
- oif = if_lookup_by_name(oifname, pim->vrf_id);
+ oif = if_lookup_by_name(oifname, pim->vrf->vrf_id);
if (!oif) {
snprintf(args->errmsg, args->errmsg_len,
pim = pim_iifp->pim;
oifname = yang_dnode_get_string(args->dnode, NULL);
- oif = if_lookup_by_name(oifname, pim->vrf_id);
+ oif = if_lookup_by_name(oifname, pim->vrf->vrf_id);
if (oif && (iif->ifindex == oif->ifindex)) {
strlcpy(args->errmsg,
pim = pim_iifp->pim;
oifname = yang_dnode_get_string(args->dnode, NULL);
- oif = if_lookup_by_name(oifname, pim->vrf_id);
+ oif = if_lookup_by_name(oifname, pim->vrf->vrf_id);
if (!oif) {
snprintf(args->errmsg, args->errmsg_len,
"No such interface name %s",
int ret;
p = &(pnc->rpf.rpf_addr);
- ret = zclient_send_rnh(zclient, command, p, false, pim->vrf_id);
+ ret = zclient_send_rnh(zclient, command, p, false, pim->vrf->vrf_id);
if (ret == ZCLIENT_SEND_FAILURE)
zlog_warn("sendmsg_nexthop: zclient_send_message() failed");
while (i < num_ifindex) {
first_ifindex = nexthop_tab[i].ifindex;
- ifp = if_lookup_by_index(first_ifindex, pim->vrf_id);
+ ifp = if_lookup_by_index(first_ifindex, pim->vrf->vrf_id);
if (!ifp) {
if (PIM_DEBUG_ZEBRA) {
char addr_str[INET_ADDRSTRLEN];
for (nh_node = pnc->nexthop; nh_node; nh_node = nh_node->next) {
first_ifindex = nh_node->ifindex;
- ifp = if_lookup_by_index(first_ifindex, pim->vrf_id);
+ ifp = if_lookup_by_index(first_ifindex, pim->vrf->vrf_id);
if (!ifp) {
if (PIM_DEBUG_PIM_NHT) {
char addr_str[INET_ADDRSTRLEN];
*/
for (nh_node = pnc->nexthop, i = 0; nh_node;
nh_node = nh_node->next, i++) {
- ifps[i] = if_lookup_by_index(nh_node->ifindex, pim->vrf_id);
+ ifps[i] =
+ if_lookup_by_index(nh_node->ifindex, pim->vrf->vrf_id);
if (ifps[i]) {
nbrs[i] = pim_neighbor_find(ifps[i],
nh_node->gate.ipv4);
break;
case NEXTHOP_TYPE_IPV6_IFINDEX:
ifp1 = if_lookup_by_index(nexthop->ifindex,
- pim->vrf_id);
+ pim->vrf->vrf_id);
if (!ifp1)
nbr = NULL;
break;
}
- ifp = if_lookup_by_index(nexthop->ifindex, pim->vrf_id);
+ ifp = if_lookup_by_index(nexthop->ifindex,
+ pim->vrf->vrf_id);
if (!ifp) {
if (PIM_DEBUG_PIM_NHT) {
char buf[NEXTHOP_STRLEN];
*/
for (i = 0; i < num_ifindex; i++) {
ifps[i] = if_lookup_by_index(nexthop_tab[i].ifindex,
- pim->vrf_id);
+ pim->vrf->vrf_id);
if (ifps[i]) {
nbrs[i] = pim_neighbor_find(
ifps[i], nexthop_tab[i].nexthop_addr.u.prefix4);
if (PIM_DEBUG_PIM_NHT)
zlog_debug(
"%s: found nexthop ifindex=%d (interface %s(%s)) for address %s",
- __func__, ifindex, ifindex2ifname(ifindex, pim->vrf_id),
+ __func__, ifindex,
+ ifindex2ifname(ifindex, pim->vrf->vrf_id),
pim->vrf->name, addr_str);
vif_index = pim_if_find_vifindex_by_ifindex(pim, ifindex);
* the right ifindex, so just use it. We know
* it's the right interface because we bind to it
*/
- ifp = if_lookup_by_index(ifindex, pim_ifp->pim->vrf_id);
+ ifp = if_lookup_by_index(ifindex, pim_ifp->pim->vrf->vrf_id);
if (!ifp || !ifp->info) {
if (PIM_DEBUG_PIM_PACKETS)
zlog_debug(
bool pim_rp_check_is_my_ip_address(struct pim_instance *pim,
struct in_addr dest_addr)
{
- if (if_lookup_exact_address(&dest_addr, AF_INET, pim->vrf_id))
+ if (if_lookup_exact_address(&dest_addr, AF_INET, pim->vrf->vrf_id))
return true;
return false;
continue;
struct interface *ifp1 = if_lookup_by_index(
- nh_node->ifindex, pim->vrf_id);
+ nh_node->ifindex, pim->vrf->vrf_id);
if (nbr->interface != ifp1)
continue;
while (!found && (i < num_ifindex)) {
first_ifindex = nexthop_tab[i].ifindex;
- ifp = if_lookup_by_index(first_ifindex, pim->vrf_id);
+ ifp = if_lookup_by_index(first_ifindex, pim->vrf->vrf_id);
if (!ifp) {
if (PIM_DEBUG_ZEBRA) {
char addr_str[INET_ADDRSTRLEN];
struct pim_ssm *ssm;
int change = 0;
- if (vrf_id != pim->vrf_id)
+ if (vrf_id != pim->vrf->vrf_id)
return PIM_SSM_ERR_NO_VRF;
ssm = pim->ssm_info;
return -1;
}
- ifp = if_lookup_by_index(ifindex, ss->pim->vrf_id);
+ ifp = if_lookup_by_index(ifindex, ss->pim->vrf->vrf_id);
if (buf[0] != PIM_SSMPINGD_REQUEST) {
char source_str[INET_ADDRSTRLEN];
struct pim_ssm *ssm = pim->ssm_info;
char spaces[10];
- if (pim->vrf_id == VRF_DEFAULT)
+ if (pim->vrf->vrf_id == VRF_DEFAULT)
snprintf(spaces, sizeof(spaces), "%s", "");
else
snprintf(spaces, sizeof(spaces), "%s", " ");
writes += pim_rp_config_write(pim, vty, spaces);
- if (pim->vrf_id == VRF_DEFAULT) {
+ if (pim->vrf->vrf_id == VRF_DEFAULT) {
if (router->register_suppress_time
!= PIM_REGISTER_SUPPRESSION_TIME_DEFAULT) {
vty_out(vty, "%sip pim register-suppress-time %d\n",
struct pim_interface *pim_ifp = ifp->info;
struct pim_instance *pim = pim_ifp->pim;
- if (pim->vrf_id != VRF_DEFAULT)
+ if (pim->vrf->vrf_id != VRF_DEFAULT)
return;
if (if_is_loopback_or_vrf(ifp))
struct pim_interface *pim_ifp = ifp->info;
struct pim_instance *pim = pim_ifp->pim;
- if (pim->vrf_id != VRF_DEFAULT)
+ if (pim->vrf->vrf_id != VRF_DEFAULT)
return;
if (pim->vxlan.default_iif == ifp)
return -1;
stream_reset(s);
- zclient_create_header(s, ZEBRA_IPMR_ROUTE_STATS, c_oil->pim->vrf_id);
+ zclient_create_header(s, ZEBRA_IPMR_ROUTE_STATS,
+ c_oil->pim->vrf->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);