summaryrefslogtreecommitdiffstats
path: root/zebra/rtadv.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2016-10-30 22:50:26 +0100
committerRenato Westphal <renato@opensourcerouting.org>2016-11-28 19:18:35 +0100
commit661512bf053ecc3d441bb8938dcd4541ae7ffc33 (patch)
tree01233125543e939ed1e5bd23c050509755c5db50 /zebra/rtadv.c
parentlib/zebra: put vrf_get() on a diet (diff)
downloadfrr-661512bf053ecc3d441bb8938dcd4541ae7ffc33.tar.xz
frr-661512bf053ecc3d441bb8938dcd4541ae7ffc33.zip
zebra/lib: remove redundant fields from zebra_vrf
There's no need to duplicate the 'vrf_id' and 'name' fields from the 'vrf' structure into the 'zebra_vrf' structure. Instead of that, add a back pointer in 'zebra_vrf' that should point to the associated 'vrf' structure. Additionally, modify the vrf callbacks to pass the whole vrf structure as a parameter. This allow us to make further simplifications in the code. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'zebra/rtadv.c')
-rw-r--r--zebra/rtadv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/zebra/rtadv.c b/zebra/rtadv.c
index 1ab7ac147..26c83bc6a 100644
--- a/zebra/rtadv.c
+++ b/zebra/rtadv.c
@@ -826,7 +826,7 @@ zebra_interface_radv_set (struct zserv *client, int sock, u_short length,
if (IS_ZEBRA_DEBUG_EVENT)
zlog_debug("%u: IF %u RA %s from client %s, interval %ds",
- zvrf->vrf_id, ifindex, enable ? "enable" : "disable",
+ zvrf_id (zvrf), ifindex, enable ? "enable" : "disable",
zebra_route_string(client->proto), ra_interval);
/* Locate interface and check VRF match. */
@@ -834,14 +834,14 @@ zebra_interface_radv_set (struct zserv *client, int sock, u_short length,
if (!ifp)
{
zlog_warn("%u: IF %u RA %s client %s - interface unknown",
- zvrf->vrf_id, ifindex, enable ? "enable" : "disable",
+ zvrf_id (zvrf), ifindex, enable ? "enable" : "disable",
zebra_route_string(client->proto));
return;
}
- if (ifp->vrf_id != zvrf->vrf_id)
+ if (ifp->vrf_id != zvrf_id (zvrf))
{
zlog_warn("%u: IF %u RA %s client %s - VRF mismatch, IF VRF %u",
- zvrf->vrf_id, ifindex, enable ? "enable" : "disable",
+ zvrf_id (zvrf), ifindex, enable ? "enable" : "disable",
zebra_route_string(client->proto), ifp->vrf_id);
return;
}