summaryrefslogtreecommitdiffstats
path: root/pimd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-06-22 19:35:45 +0200
committerGitHub <noreply@github.com>2019-06-22 19:35:45 +0200
commita12bb225a6681b7e7eb0aac105cbc8b745675131 (patch)
treeadb8d7935dcb1da93d6cf4082f903e412e292640 /pimd
parentMerge pull request #4294 from adharkar/frr-master-fpm_rmac (diff)
parent*: change interface structure, from vrf_id to vrf (diff)
downloadfrr-a12bb225a6681b7e7eb0aac105cbc8b745675131.tar.xz
frr-a12bb225a6681b7e7eb0aac105cbc8b745675131.zip
Merge pull request #3775 from pguibert6WIND/ospf_missing_interface_handling_2
Ospf missing interface handling 2
Diffstat (limited to 'pimd')
-rw-r--r--pimd/pim_cmd.c10
-rw-r--r--pimd/pim_iface.c14
-rw-r--r--pimd/pim_msdp_socket.c4
-rw-r--r--pimd/pim_static.c2
-rw-r--r--pimd/pim_zebra.c7
5 files changed, 19 insertions, 18 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index c6617d9d2..d71b4bf64 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -7655,7 +7655,7 @@ DEFUN (interface_ip_mroute,
pim = pim_ifp->pim;
oifname = argv[idx_interface]->arg;
- oif = if_lookup_by_name(oifname, pim->vrf_id);
+ oif = if_lookup_by_name(oifname, pim->vrf);
if (!oif) {
vty_out(vty, "No such interface name %s\n", oifname);
return CMD_WARNING;
@@ -7706,7 +7706,7 @@ DEFUN (interface_ip_mroute_source,
pim = pim_ifp->pim;
oifname = argv[idx_interface]->arg;
- oif = if_lookup_by_name(oifname, pim->vrf_id);
+ oif = if_lookup_by_name(oifname, pim->vrf);
if (!oif) {
vty_out(vty, "No such interface name %s\n", oifname);
return CMD_WARNING;
@@ -7761,7 +7761,7 @@ DEFUN (interface_no_ip_mroute,
pim = pim_ifp->pim;
oifname = argv[idx_interface]->arg;
- oif = if_lookup_by_name(oifname, pim->vrf_id);
+ oif = if_lookup_by_name(oifname, pim->vrf);
if (!oif) {
vty_out(vty, "No such interface name %s\n", oifname);
return CMD_WARNING;
@@ -7813,7 +7813,7 @@ DEFUN (interface_no_ip_mroute_source,
pim = pim_ifp->pim;
oifname = argv[idx_interface]->arg;
- oif = if_lookup_by_name(oifname, pim->vrf_id);
+ oif = if_lookup_by_name(oifname, pim->vrf);
if (!oif) {
vty_out(vty, "No such interface name %s\n", oifname);
return CMD_WARNING;
@@ -10136,7 +10136,7 @@ DEFUN_HIDDEN (ip_pim_mlag,
idx = 3;
peerlink = argv[idx]->arg;
- ifp = if_lookup_by_name(peerlink, VRF_DEFAULT);
+ ifp = if_lookup_by_name(peerlink, vrf_lookup_by_id(VRF_DEFAULT));
if (!ifp) {
vty_out(vty, "No such interface name %s\n", peerlink);
return CMD_WARNING;
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index 7b8f04569..6ccc6ed19 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -120,7 +120,7 @@ struct pim_interface *pim_if_new(struct interface *ifp, bool igmp, bool pim,
pim_ifp = XCALLOC(MTYPE_PIM_INTERFACE, sizeof(*pim_ifp));
pim_ifp->options = 0;
- pim_ifp->pim = pim_get_pim_instance(ifp->vrf_id);
+ pim_ifp->pim = pim_get_pim_instance(vrf_to_id(ifp->vrf));
pim_ifp->mroute_vif_index = -1;
pim_ifp->igmp_version = IGMP_DEFAULT_VERSION;
@@ -781,7 +781,7 @@ void pim_if_addr_del_all(struct interface *ifp)
struct connected *ifc;
struct listnode *node;
struct listnode *nextnode;
- struct vrf *vrf = vrf_lookup_by_id(ifp->vrf_id);
+ struct vrf *vrf = ifp->vrf;
struct pim_instance *pim;
if (!vrf)
@@ -853,7 +853,7 @@ struct in_addr pim_find_primary_addr(struct interface *ifp)
int v4_addrs = 0;
int v6_addrs = 0;
struct pim_interface *pim_ifp = ifp->info;
- struct vrf *vrf = vrf_lookup_by_id(ifp->vrf_id);
+ struct vrf *vrf = ifp->vrf;
if (!vrf)
return addr;
@@ -894,10 +894,10 @@ struct in_addr pim_find_primary_addr(struct interface *ifp)
if (!v4_addrs && v6_addrs && !if_is_loopback(ifp)) {
struct interface *lo_ifp;
// DBS - Come back and check here
- if (ifp->vrf_id == VRF_DEFAULT)
- lo_ifp = if_lookup_by_name("lo", vrf->vrf_id);
+ if (!ifp->vrf || ifp->vrf->vrf_id == VRF_DEFAULT)
+ lo_ifp = if_lookup_by_name("lo", vrf);
else
- lo_ifp = if_lookup_by_name(vrf->name, vrf->vrf_id);
+ lo_ifp = if_lookup_by_name(vrf->name, vrf);
if (lo_ifp)
return pim_find_primary_addr(lo_ifp);
@@ -1480,7 +1480,7 @@ void pim_if_create_pimreg(struct pim_instance *pim)
snprintf(pimreg_name, sizeof(pimreg_name), "pimreg%u",
pim->vrf->data.l.table_id);
- pim->regiface = if_create(pimreg_name, pim->vrf_id);
+ pim->regiface = if_create(pimreg_name, pim->vrf);
pim->regiface->ifindex = PIM_OIF_PIM_REGISTER_VIF;
pim_if_new(pim->regiface, false, false, true,
diff --git a/pimd/pim_msdp_socket.c b/pimd/pim_msdp_socket.c
index b1f7cfd2c..954b5dee7 100644
--- a/pimd/pim_msdp_socket.c
+++ b/pimd/pim_msdp_socket.c
@@ -158,7 +158,7 @@ int pim_msdp_sock_listen(struct pim_instance *pim)
if (pim->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);
if (!ifp) {
flog_err(EC_LIB_INTERFACE,
"%s: Unable to lookup vrf interface: %s",
@@ -239,7 +239,7 @@ int pim_msdp_sock_connect(struct pim_msdp_peer *mp)
if (mp->pim->vrf_id != VRF_DEFAULT) {
struct interface *ifp =
- if_lookup_by_name(mp->pim->vrf->name, mp->pim->vrf_id);
+ if_lookup_by_name(mp->pim->vrf->name, mp->pim->vrf);
if (!ifp) {
flog_err(EC_LIB_INTERFACE,
"%s: Unable to lookup vrf interface: %s",
diff --git a/pimd/pim_static.c b/pimd/pim_static.c
index 442b22e06..4ddf21951 100644
--- a/pimd/pim_static.c
+++ b/pimd/pim_static.c
@@ -92,7 +92,7 @@ int pim_static_add(struct pim_instance *pim, struct interface *iif,
return -4;
}
#endif
- if (iif->vrf_id != oif->vrf_id) {
+ if (iif->vrf != oif->vrf) {
return -3;
}
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index 4cebc43a0..eef36288d 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -211,11 +211,12 @@ static int pim_zebra_if_state_up(ZAPI_CALLBACK_ARGS)
*/
if (sscanf(ifp->name, "pimreg%" SCNu32, &table_id) == 1) {
struct vrf *vrf;
+
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if ((table_id == vrf->data.l.table_id)
- && (ifp->vrf_id != vrf->vrf_id)) {
+ && (ifp->vrf != vrf)) {
struct interface *master = if_lookup_by_name(
- vrf->name, vrf->vrf_id);
+ vrf->name, vrf);
if (!master) {
zlog_debug(
@@ -290,7 +291,7 @@ static int pim_zebra_interface_vrf_update(ZAPI_CALLBACK_ARGS)
__PRETTY_FUNCTION__,
ifp->name, vrf_id, new_vrf_id);
- if_update_to_new_vrf(ifp, new_vrf_id);
+ if_update_to_new_vrf(ifp, vrf_lookup_by_id(new_vrf_id));
return 0;
}