summaryrefslogtreecommitdiff
path: root/lib/zclient.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/zclient.c')
-rw-r--r--lib/zclient.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index da8dc4e906..94d92f67e7 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -1469,6 +1469,11 @@ struct interface *zebra_interface_add_read(struct stream *s, vrf_id_t vrf_id)
/* Lookup/create interface by name. */
ifp = if_get_by_name(ifname_tmp, vrf);
+ /* update vrf_id of interface */
+ if (ifp->vrf->vrf_id == VRF_UNKNOWN &&
+ vrf->vrf_id != VRF_UNKNOWN)
+ ifp->vrf = vrf;
+
zebra_interface_if_set_value(s, ifp);
return ifp;
@@ -2844,11 +2849,12 @@ void zclient_interface_set_master(struct zclient *client,
s = client->obuf;
stream_reset(s);
- zclient_create_header(s, ZEBRA_INTERFACE_SET_MASTER, master->vrf_id);
+ zclient_create_header(s, ZEBRA_INTERFACE_SET_MASTER,
+ vrf_to_id(master->vrf));
- stream_putl(s, master->vrf_id);
+ stream_putl(s, vrf_to_id(master->vrf));
stream_putl(s, master->ifindex);
- stream_putl(s, slave->vrf_id);
+ stream_putl(s, vrf_to_id(slave->vrf));
stream_putl(s, slave->ifindex);
stream_putw_at(s, 0, stream_get_endp(s));