summaryrefslogtreecommitdiff
path: root/vrrpd
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 /vrrpd
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 'vrrpd')
-rw-r--r--vrrpd/vrrp.c12
-rw-r--r--vrrpd/vrrp_zebra.c32
2 files changed, 22 insertions, 22 deletions
diff --git a/vrrpd/vrrp.c b/vrrpd/vrrp.c
index 775611b3e3..4e2c12c4e0 100644
--- a/vrrpd/vrrp.c
+++ b/vrrpd/vrrp.c
@@ -216,7 +216,7 @@ static struct vrrp_vrouter *vrrp_lookup_by_if_mvl(struct interface *mvl_ifp)
return NULL;
}
- p = if_lookup_by_index(mvl_ifp->link_ifindex, mvl_ifp->vrf_id);
+ p = if_lookup_by_index(mvl_ifp->link_ifindex, mvl_ifp->vrf->vrf_id);
if (!p) {
DEBUGD(&vrrp_dbg_zebra,
@@ -544,7 +544,7 @@ static bool vrrp_attach_interface(struct vrrp_router *r)
size_t ifps_cnt =
if_lookup_by_hwaddr(r->vmac.octet, sizeof(r->vmac.octet), &ifps,
- r->vr->ifp->vrf_id);
+ r->vr->ifp->vrf->vrf_id);
/*
* Filter to only those macvlan interfaces whose parent is the base
@@ -1083,9 +1083,9 @@ static int vrrp_socket(struct vrrp_router *r)
frr_with_privs(&vrrp_privs) {
r->sock_rx = vrf_socket(r->family, SOCK_RAW, IPPROTO_VRRP,
- r->vr->ifp->vrf_id, NULL);
+ r->vr->ifp->vrf->vrf_id, NULL);
r->sock_tx = vrf_socket(r->family, SOCK_RAW, IPPROTO_VRRP,
- r->vr->ifp->vrf_id, NULL);
+ r->vr->ifp->vrf->vrf_id, NULL);
}
if (r->sock_rx < 0 || r->sock_tx < 0) {
@@ -1102,7 +1102,7 @@ static int vrrp_socket(struct vrrp_router *r)
* Bind Tx socket to macvlan device - necessary for VRF support,
* otherwise the kernel will select the vrf device
*/
- if (r->vr->ifp->vrf_id != VRF_DEFAULT) {
+ if (r->vr->ifp->vrf->vrf_id != VRF_DEFAULT) {
frr_with_privs (&vrrp_privs) {
ret = setsockopt(r->sock_tx, SOL_SOCKET,
SO_BINDTODEVICE, r->mvl_ifp->name,
@@ -1751,7 +1751,7 @@ vrrp_autoconfig_autocreate(struct interface *mvl_ifp)
struct interface *p;
struct vrrp_vrouter *vr;
- p = if_lookup_by_index(mvl_ifp->link_ifindex, mvl_ifp->vrf_id);
+ p = if_lookup_by_index(mvl_ifp->link_ifindex, mvl_ifp->vrf->vrf_id);
if (!p)
return NULL;
diff --git a/vrrpd/vrrp_zebra.c b/vrrpd/vrrp_zebra.c
index d7d37f1f33..4cea8ebe4a 100644
--- a/vrrpd/vrrp_zebra.c
+++ b/vrrpd/vrrp_zebra.c
@@ -34,15 +34,15 @@
static struct zclient *zclient;
-static void vrrp_zebra_debug_if_state(struct interface *ifp, vrf_id_t vrf_id,
- const char *func)
+static void vrrp_zebra_debug_if_state(struct interface *ifp, const char *func)
{
DEBUGD(&vrrp_dbg_zebra,
- "%s: %s index %d(%u) parent %d mac %02x:%02x:%02x:%02x:%02x:%02x flags %ld metric %d mtu %d operative %d",
- func, ifp->name, vrf_id, ifp->link_ifindex, ifp->ifindex,
- ifp->hw_addr[0], ifp->hw_addr[1], ifp->hw_addr[2],
- ifp->hw_addr[3], ifp->hw_addr[4], ifp->hw_addr[5],
- (long)ifp->flags, ifp->metric, ifp->mtu, if_is_operative(ifp));
+ "%s: %s index %d vrf %s(%u) parent %d mac %02x:%02x:%02x:%02x:%02x:%02x flags %ld metric %d mtu %d operative %d",
+ func, ifp->name, ifp->ifindex, ifp->vrf->name, ifp->vrf->vrf_id,
+ ifp->link_ifindex, ifp->hw_addr[0], ifp->hw_addr[1],
+ ifp->hw_addr[2], ifp->hw_addr[3], ifp->hw_addr[4],
+ ifp->hw_addr[5], (long)ifp->flags, ifp->metric, ifp->mtu,
+ if_is_operative(ifp));
}
static void vrrp_zebra_debug_if_dump_address(struct interface *ifp,
@@ -82,7 +82,7 @@ static int vrrp_router_id_update_zebra(int command, struct zclient *zclient,
int vrrp_ifp_create(struct interface *ifp)
{
- vrrp_zebra_debug_if_state(ifp, ifp->vrf_id, __func__);
+ vrrp_zebra_debug_if_state(ifp, __func__);
vrrp_if_add(ifp);
@@ -91,7 +91,7 @@ int vrrp_ifp_create(struct interface *ifp)
int vrrp_ifp_destroy(struct interface *ifp)
{
- vrrp_zebra_debug_if_state(ifp, ifp->vrf_id, __func__);
+ vrrp_zebra_debug_if_state(ifp, __func__);
vrrp_if_del(ifp);
@@ -100,7 +100,7 @@ int vrrp_ifp_destroy(struct interface *ifp)
int vrrp_ifp_up(struct interface *ifp)
{
- vrrp_zebra_debug_if_state(ifp, ifp->vrf_id, __func__);
+ vrrp_zebra_debug_if_state(ifp, __func__);
vrrp_if_up(ifp);
@@ -109,7 +109,7 @@ int vrrp_ifp_up(struct interface *ifp)
int vrrp_ifp_down(struct interface *ifp)
{
- vrrp_zebra_debug_if_state(ifp, ifp->vrf_id, __func__);
+ vrrp_zebra_debug_if_state(ifp, __func__);
vrrp_if_down(ifp);
@@ -134,7 +134,7 @@ static int vrrp_zebra_if_address_add(int command, struct zclient *zclient,
if (!c)
return 0;
- vrrp_zebra_debug_if_state(c->ifp, vrf_id, __func__);
+ vrrp_zebra_debug_if_state(c->ifp, __func__);
vrrp_zebra_debug_if_dump_address(c->ifp, __func__);
vrrp_if_address_add(c->ifp);
@@ -160,7 +160,7 @@ static int vrrp_zebra_if_address_del(int command, struct zclient *client,
if (!c)
return 0;
- vrrp_zebra_debug_if_state(c->ifp, vrf_id, __func__);
+ vrrp_zebra_debug_if_state(c->ifp, __func__);
vrrp_zebra_debug_if_dump_address(c->ifp, __func__);
vrrp_if_address_del(c->ifp);
@@ -175,8 +175,8 @@ void vrrp_zebra_radv_set(struct vrrp_router *r, bool enable)
"Requesting Zebra to turn router advertisements %s for %s",
r->vr->vrid, enable ? "on" : "off", r->mvl_ifp->name);
- zclient_send_interface_radv_req(zclient, r->mvl_ifp->vrf_id, r->mvl_ifp,
- enable, VRRP_RADV_INT);
+ zclient_send_interface_radv_req(zclient, r->mvl_ifp->vrf->vrf_id,
+ r->mvl_ifp, enable, VRRP_RADV_INT);
}
void vrrp_zclient_send_interface_protodown(struct interface *ifp, bool down)
@@ -185,7 +185,7 @@ void vrrp_zclient_send_interface_protodown(struct interface *ifp, bool down)
VRRP_LOGPFX "Requesting Zebra to set %s protodown %s", ifp->name,
down ? "on" : "off");
- zclient_send_interface_protodown(zclient, ifp->vrf_id, ifp, down);
+ zclient_send_interface_protodown(zclient, ifp->vrf->vrf_id, ifp, down);
}
static zclient_handler *const vrrp_handlers[] = {