diff options
| author | Mark Stapp <mjs@voltanet.io> | 2021-10-19 16:46:58 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-19 16:46:58 -0400 |
| commit | 32c8a3c2ae48d85bd855b0ebb55c426121be843a (patch) | |
| tree | 2b489718f0d61ed4c5b043959bcbe3e18035d874 /lib/zclient.c | |
| parent | e9f7b2b597ad8c6947ce3b7238e89391e4f9f863 (diff) | |
| parent | f60a11883cb426f574dbe5abeff8254148e7c371 (diff) | |
Merge pull request #9818 from idryzhov/lib-if-fixes
lib: allow to create interfaces in non-existing VRFs
Diffstat (limited to 'lib/zclient.c')
| -rw-r--r-- | lib/zclient.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index d639fa84b8..eea118738c 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -2164,19 +2164,21 @@ static int zclient_interface_add(struct zclient *zclient, vrf_id_t vrf_id) struct interface *ifp; char ifname_tmp[INTERFACE_NAMSIZ + 1] = {}; struct stream *s = zclient->ibuf; + struct vrf *vrf; /* Read interface name. */ STREAM_GET(ifname_tmp, s, INTERFACE_NAMSIZ); /* Lookup/create interface by name. */ - if (!vrf_get(vrf_id, NULL)) { + vrf = vrf_lookup_by_id(vrf_id); + if (!vrf) { zlog_debug( "Rx'd interface add from Zebra, but VRF %u does not exist", vrf_id); return -1; } - ifp = if_get_by_name(ifname_tmp, vrf_id); + ifp = if_get_by_name(ifname_tmp, vrf_id, vrf->name); zebra_interface_if_set_value(s, ifp); |
