summaryrefslogtreecommitdiffstats
path: root/pimd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-06-24 01:46:39 +0200
committerGitHub <noreply@github.com>2019-06-24 01:46:39 +0200
commita36898e7555036c786f7aa944b848966b45d5897 (patch)
treefb34f0ca1836e09a8e89e73ebd6696a08b89b631 /pimd
parentMerge pull request #3775 from pguibert6WIND/ospf_missing_interface_handling_2 (diff)
downloadfrr-a36898e7555036c786f7aa944b848966b45d5897.tar.xz
frr-a36898e7555036c786f7aa944b848966b45d5897.zip
Revert "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, 18 insertions, 19 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index d71b4bf64..c6617d9d2 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);
+ oif = if_lookup_by_name(oifname, pim->vrf_id);
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);
+ oif = if_lookup_by_name(oifname, pim->vrf_id);
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);
+ oif = if_lookup_by_name(oifname, pim->vrf_id);
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);
+ oif = if_lookup_by_name(oifname, pim->vrf_id);
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_lookup_by_id(VRF_DEFAULT));
+ ifp = if_lookup_by_name(peerlink, 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 6ccc6ed19..7b8f04569 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(vrf_to_id(ifp->vrf));
+ pim_ifp->pim = pim_get_pim_instance(ifp->vrf_id);
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 = ifp->vrf;
+ struct vrf *vrf = vrf_lookup_by_id(ifp->vrf_id);
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 = ifp->vrf;
+ struct vrf *vrf = vrf_lookup_by_id(ifp->vrf_id);
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 || ifp->vrf->vrf_id == VRF_DEFAULT)
- lo_ifp = if_lookup_by_name("lo", vrf);
+ if (ifp->vrf_id == VRF_DEFAULT)
+ lo_ifp = if_lookup_by_name("lo", vrf->vrf_id);
else
- lo_ifp = if_lookup_by_name(vrf->name, vrf);
+ lo_ifp = if_lookup_by_name(vrf->name, vrf->vrf_id);
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);
+ pim->regiface = if_create(pimreg_name, pim->vrf_id);
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 954b5dee7..b1f7cfd2c 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);
+ if_lookup_by_name(pim->vrf->name, pim->vrf_id);
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);
+ if_lookup_by_name(mp->pim->vrf->name, mp->pim->vrf_id);
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 4ddf21951..442b22e06 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 != oif->vrf) {
+ if (iif->vrf_id != oif->vrf_id) {
return -3;
}
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index eef36288d..4cebc43a0 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -211,12 +211,11 @@ 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 != vrf)) {
+ && (ifp->vrf_id != vrf->vrf_id)) {
struct interface *master = if_lookup_by_name(
- vrf->name, vrf);
+ vrf->name, vrf->vrf_id);
if (!master) {
zlog_debug(
@@ -291,7 +290,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, vrf_lookup_by_id(new_vrf_id));
+ if_update_to_new_vrf(ifp, new_vrf_id);
return 0;
}