summaryrefslogtreecommitdiff
path: root/nhrpd
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-10-22 01:17:40 +0300
committerIgor Ryzhov <iryzhov@nfware.com>2021-11-22 20:47:23 +0300
commit096f7609f9168ad1a2503acad31d3afc8f00f9e5 (patch)
tree7acf9cbf0f944b032da6a796fcf8d7f6a06fe90a /nhrpd
parentd32c92a4c0fcee71a8a6d02cb9ff84607cfdcc07 (diff)
*: cleanup ifp->vrf_id
Since f60a1188 we store a pointer to the VRF in the interface structure. There's no need anymore to store a separate vrf_id field. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'nhrpd')
-rw-r--r--nhrpd/nhrp_interface.c10
-rw-r--r--nhrpd/nhrp_route.c8
2 files changed, 7 insertions, 11 deletions
diff --git a/nhrpd/nhrp_interface.c b/nhrpd/nhrp_interface.c
index 94cec0281f..1092ce13a1 100644
--- a/nhrpd/nhrp_interface.c
+++ b/nhrpd/nhrp_interface.c
@@ -143,13 +143,13 @@ static void nhrp_interface_update_source(struct interface *ifp)
{
struct nhrp_interface *nifp = ifp->info;
- if (!nifp->source || !nifp->nbmaifp ||
- ((ifindex_t)nifp->link_idx == nifp->nbmaifp->ifindex &&
- (nifp->link_vrf_id == nifp->nbmaifp->vrf_id)))
+ if (!nifp->source || !nifp->nbmaifp
+ || ((ifindex_t)nifp->link_idx == nifp->nbmaifp->ifindex
+ && (nifp->link_vrf_id == nifp->nbmaifp->vrf->vrf_id)))
return;
nifp->link_idx = nifp->nbmaifp->ifindex;
- nifp->link_vrf_id = nifp->nbmaifp->vrf_id;
+ nifp->link_vrf_id = nifp->nbmaifp->vrf->vrf_id;
debugf(NHRP_DEBUG_IF, "%s: bound device index changed to %d, vr %u",
ifp->name, nifp->link_idx, nifp->link_vrf_id);
nhrp_send_zebra_gre_source_set(ifp, nifp->link_idx, nifp->link_vrf_id);
@@ -414,7 +414,7 @@ static void interface_config_update_nhrp_map(struct nhrp_cache_config *cc,
return;
/* gre layer not ready */
- if (ifp->vrf_id == VRF_UNKNOWN)
+ if (ifp->vrf->vrf_id == VRF_UNKNOWN)
return;
c = nhrp_cache_get(ifp, &cc->remote_addr, ctx->enabled ? 1 : 0);
diff --git a/nhrpd/nhrp_route.c b/nhrpd/nhrp_route.c
index 76e0978cb6..698c6d0cdf 100644
--- a/nhrpd/nhrp_route.c
+++ b/nhrpd/nhrp_route.c
@@ -408,9 +408,7 @@ void nhrp_send_zebra_configure_arp(struct interface *ifp, int family)
}
s = zclient->obuf;
stream_reset(s);
- zclient_create_header(s,
- ZEBRA_CONFIGURE_ARP,
- ifp->vrf_id);
+ zclient_create_header(s, ZEBRA_CONFIGURE_ARP, ifp->vrf->vrf_id);
stream_putc(s, family);
stream_putl(s, ifp->ifindex);
stream_putw_at(s, 0, stream_get_endp(s));
@@ -433,9 +431,7 @@ void nhrp_send_zebra_gre_source_set(struct interface *ifp,
}
s = zclient->obuf;
stream_reset(s);
- zclient_create_header(s,
- ZEBRA_GRE_SOURCE_SET,
- ifp->vrf_id);
+ zclient_create_header(s, ZEBRA_GRE_SOURCE_SET, ifp->vrf->vrf_id);
stream_putl(s, ifp->ifindex);
stream_putl(s, link_idx);
stream_putl(s, link_vrf_id);